Created
May 26, 2011 08:49
-
-
Save kanduvisla/992795 to your computer and use it in GitHub Desktop.
Symphony extension template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Class extension_[name] extends Extension | |
{ | |
/** | |
* About this extension | |
* @return array | |
*/ | |
public function about() | |
{ | |
return array( | |
'name' => '', | |
'version' => '1.0', | |
'release-date' => '2011-05-26', | |
'author' => array( | |
'name' => 'Giel Berkers', | |
'website' => 'http://www.gielberkers.com', | |
'email' => 'info@gielberkers.com' | |
) | |
); | |
} | |
/** | |
* Return an array with delegates | |
* @return array | |
*/ | |
public function getSubscribedDelegates() { | |
return array( | |
// Delegates | |
array( | |
'page' => '', | |
'delegate' => '', | |
'callback' => '' | |
) | |
); | |
} | |
/** | |
* Installation script | |
* @return void | |
*/ | |
public function install() | |
{ | |
Symphony::Database()->query("CREATE TABLE IF NOT EXISTS `tbl_fields_[name]` ( | |
`id` int(11) unsigned NOT NULL auto_increment, | |
`field_id` int(11) unsigned NOT NULL, | |
[additional fields] | |
PRIMARY KEY (`id`), | |
KEY `field_id` (`field_id`) | |
)"); | |
} | |
/** | |
* Uninstallation script | |
* @return void | |
*/ | |
public function uninstall() | |
{ | |
Symphony::Database()->query('DROP TABLE `tbl_fields_[name]`'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment