Example Template
This is an open discussion with 4 replies, filed under Extensions.
Search
So far, one problem with the Example extension is the inclusion of an empty install
function.
public function install(){ }
By removing this, the extension can be installed. The extension.driver.php
file should look something like this:
<?php Class extension_example extends Extension{ public function about(){ return array('name' => 'Example Extension', 'version' => '1.0', 'release-date' => '2008-12-25', 'author' => array('name' => 'Author Name', 'website' => 'http://www.example.com', 'email' => 'username@example.com') ); } public function uninstall(){ } public function update(){ } public function enable(){ } public function disable(){ } public function getSubscribedDelegates(){ } public function fetchNavigation(){ } }
Thanks for working on this bauhouse.
Just some info: install(), enable(), disable() and update() functions should return true on success.
If You don't have anything to do when they're called, You can remove them form Your extension.driver.php file. They are implemented by base class, i.e., Extension, so it's not required to have them in Your extension class :).
Also getSubscribedDelegates() and fetchNavigation() are not required in Your class. It's only when You want to override them, i.e., do something when they are called, You have to include them in Your code.
Thanks, ahwayakchih. I figured that these empty functions would only be necessary if they would be overriding the existing functions.
Let's see if I can follow the breadcrumbs:
An extension is created as a subclass of the Extension
class
symphony/lib/toolkit/class.extension.php
The Extension
class is called by the __buildNavigation
function of the AdministrationPage class on line 404
symphony/lib/toolkit/class.administrationpage.php
The AdministrationPage
class is a subclass of the HTMLPage
class
symphony/lib/toolkit/class.htmlpage.php
The HTMLPage
class is a subclass of the Page
class. A require
statement in the class.htmlpage.php
file loads the Page
class before declaring the HTMLPage
class.
symphony/lib/toolkit/class.page.php
The Page
class is loaded by the Symphony
class file
symphony/lib/core/class.symphony.php
The Symphony
class is loaded by the core Administration
class file and
symphony/lib/core/class.administration.php
The Administration
and FrontEnd
classes are subclasses of the Symphony class. The Symphony
class is loaded by the Symphony admin and front end pages
index.php symphony/index.php
Create an account or sign in to comment.
Be warned that this will be an ongoing log of myself fumbling around with PHP (very little experience with this) and the undocumented Symphony Extensions API as I poke around to figure out how extensions work. I'm basing this on the deprecated Campfire API wiki documentation and the numerous examples of working extensions already available for Symphony 2.0.
Attached is a template that I will use as a starting point.
Attachments