I have been trying to write a Controller Plugin which I will be using for user authentication.
I have written the plugin and it should work but I just don’t get how to get the plugin loaded… I have read that the Zend Framework has a lot of autoloading possibilities..
My current directory structure:
domains
example.com
Application
configs
controllers
IndexController.php
AuthController.php
ErrorController.php
forms
layouts
scripts
layout.phtml
models
plugins
AuthenticationPlugin.php
views
helpers
scripts
auth
login.phtml
error
error.phtml
index
index.phtml
Bootstrap.php
library
Zend
pubic_html
.htaccess
index.php
Can anyone help me?
Thanks in advance!
Assuming your
appnamespaceisApplication_, then your plugin class should be:named
Application_Plugin_AuthenticationPluginstored in the file
application/plugins/AuthenticationPlugin.phpregistered with the frontcontroller using something like (in
application/configs/application.ini):resources.frontController.plugins.auth = "Application_Plugin_AuthenticationPlugin"