views:

49

answers:

1

I want to be able to store custom plugins in the library folder of my application (currently I am storing them in the Zend library itself). Is there a way of providing additional plugin directories in the application.ini file?

+1  A: 

I figured this one out:

Create a folder in:

 application/library/PREFIX

(where PREFIX is the class prefix for your plugin, and it's root directory)

In the application.ini file - add:

 autoloaderNamespaces[] = "PREFIX"

add this line to register the plugin with the Front Controller

 resources.frontController.plugins.PluginName= "PREFIX_PluginName"

If you need/want to organise your plugin folders - use the Zend underscore = directories naming convention - so this:

resources.frontController.plugins.PluginName= "PREFIX_Path_To_Folder_PluginName"

would refer to a class called:

PREFIX_Path_To_Folder_PluginName 

in a file called: "PluginName.php"

in directory:

application/library/PREFIX/Path/To/Folder/PluginName.php

Hope that helps anyone who needs to ask this question

sunwukung