You use the function like so:
plugin('foo', 'bar');
Then any classes defined in "foo" or "bar" plugin trees will be available to use.
Note: You need to apply a fix so you don't get duplicate class definition errors. See https://trac.cakephp.org/ticket/1603
/**
* Will load all the classes related to a plugin.
*/
function plugin() {
$args = func_get_args();
foreach($args as $arg) {
$plug_ctl_name = $arg . "AppController";
$plug_model_name = $arg . "AppModel";
if ( ! class_exists($plug_ctl_name) ) {
if ( class_exists("AppController") ) {
loadPluginController($arg, $arg);
}
}
if ( ! class_exists($plug_model_name) ) {
if ( class_exists("AppModel") ) {
loadPluginModels($arg);
}
}
}
}
Hello bakers
I've been thinking about how to cake recognize my plugins automatic – and adapt my views to the plugins there is active on the app (Adding menu's / features )
Does anyone have a good idea on how this could be done ?
My solution (partly) was something like:
plugins/$name/$name_install.php file for activating the plugin ( setting up database fields )
plugins/$name/$name_information.php basic information about the plugin ( version, description, friendly name )
plugins/$name/$name_uninstall.php file for deactivating the plugin ( removing tables )
and then somehow the plugin should 'publish' itself to cake what menu options it has, and what features it should add where and how
Have anything like this been made in Cake before ? Or perhaps some other framework where it would be possible to get 'inspiration' ?
/Jippi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---
