I read somewhere that using the base controller is bad, and that there are lower sides than parties. This person said you should use plugins.
I need to get a request from the variable "lang" before each action and pass it to the current action. Now I made a basic controller with preDispatch, which receives it from the request and passes it through $this (any other controller leaves the database).
How do I implement it if I use plugins? And should I?
EDIT: Found a place where I read that base controllers are evil: Sending variables to a layout in Zend Framework is a comment on the last answer. Please note that my question is not like (I need to go to action, not the layout).
EDIT2: With your answers on how to implement, could you also explain why using a base controller is bad?
EDIT3: It seems it is not working. I did: created the helpers directory in the controllers folder, added to the Zend_Controller_Action_HelperBroker::addPath('../application/default/controllers/helpers/', 'Controller_Helper'); initializer Zend_Controller_Action_HelperBroker::addPath('../application/default/controllers/helpers/', 'Controller_Helper'); Created a file in this folder LangHelper.php and created the class Controller_Helper_Lang extends Zend_Controller_Action_Helper_Abstract . Why is it still not working? (maybe I need to add a request one or more times?)
EDIT4: I get:
Zend_Loader_PluginLoader_Exception: a plugin named 'Lang' was not found in the registry; paths used: Controller_Helper _: .. /application/default/controllers/helpers/;../application/admin/controllers/helpers/ Zend_Controller_Action_Helper_: Zend / Controller / Action / Helper / in C: \ wamp \ www \ EfCom \ library \ Zend \ Loader \ PluginLoader.php on line 412
source share