Reputation: 1076
I've searched the web but couldn't find any example, so maybe you know if it's possible and whether it is a good idea.
I wrote a function adminloginCheck()
that is located in library/myNameSpace/LoginCheck.php
I moved the code I had inside the preDispatch()
of my Controller and inside preDispatch()
I'm calling $mynamespace->adminloginCheck();
in my predispatch()
I had a FlashMessanger $this->_helper->FlashMessenger($message);
but it looks like (and for sure it wouldn't) $this->_helper->FlashMessenger($message)
doesn't work in my own class - library/myNameSpace/LoginCheck.php
So my question is - how to call FlashMessenger
from outside the controller, in my own class.
I'm calling $auth = Zend_Auth::getInstance();
directly in there. So how to do the same thing with FlashMessanger?
Thanks!
Upvotes: 0
Views: 49
Reputation: 12665
try:
$messenger = new Zend_Controller_Action_Helper_FlashMessenger();
$messenger->addMessage('hello');
$messages = $messenger->getMessages();
...
Upvotes: 2