I am trying to call a view of helper from a plug in(registered in bootstrap). From any controller i am able to access without any issue but not from a plugin. Below is my code. Any help is appreciated. thank you. Miguel
class Plugins_security extends Zend_Controller_Plugin_Abstract
{
public function preDispatch (Zend_Controller_Request_Abstract $request)
{
$auth = Zend_Auth::getInstance();
$moduleName = $request->getModuleName();
if ($request->getModuleName() != "auth")
{
$auth = Zend_Auth::getInstance();
if (! $auth->hasIdentity())
{
$redirector = Zend_Controller_Action_HelperBroker::getStaticHelper(
'redirector');
$flashMessenger = Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessages');
$flashMessenger->flashMessenger (array('message' => 'Sessao expirada', 'status' => 'error'));
$redirector->gotoUrl('/auth/login/')->redirectAndExit();
}
}
}
}
I am getting the following error. Fatal error: Uncaught exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'FlashMessages' was not found in the registry; used paths: Zend_Controller_Action_Helper_: Zend/Controller/Action/Helper/' in /usr/local/zend/share/ZendFramework/library/Zend/Loader/PluginLoader.php:412 Stack trace: #0 /usr/local/zend/share/ZendFramework/library/Zend/Controller/Action/HelperBroker.php(366):