This is probably the most frustrating part for newbies learning about zend.
Where do I create my new class’ file?
There’s an exemple here:
http://forums.zend.com/viewtopic.php?f=69&t=4988
or another one here:
http://framework.zend.com/manual/1.11/en/zend.controller.plugins.html
But none of them mention where this plugin should be created?
The best idea is to put your classes where the autoloader can find them. It’s also a pseudo-convention to mimic the Zend class name structure.
For example, say you’ve made a controller plugin named “Foo”. Name the class
and save the file at
library/My/Controller/Plugin/Foo.php.To have the autoloader pick up your “My” namespace (note, this isn’t a PHP 5.3 namespace), simply add this to your
application.inifileThe only restriction here is that your “My” folder must be in the include path. Putting it in the “library” folder solves this.