Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zend-framework, call an action helper from within another action helper

Tags:

i am writing an action helper and i need to call another action helper from within that helper. but i dont know how. here in the sample code:

class Common_Controller_Action_Helper_SAMPLE extends Zend_Controller_Action_Helper_Abstract {     protected $_view;     public function __construct(Zend_View_Interface $view = null, array $options = array())     {         $this->_view = $view;     }      public function preDispatch()     {         $flashMessenger = $this->_helper->FlashMessenger; // IT IS NULL     } } 
like image 855
rahim asgari Avatar asked Jul 12 '09 16:07

rahim asgari


1 Answers

Use the action helper broker:

$flashMessenger =     Zend_Controller_Action_HelperBroker::getStaticHelper('FlashMessenger'); 
like image 157
mercator Avatar answered Nov 03 '22 11:11

mercator