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
}
}
You can also use getActionController to get a reference back to the actioncontroller you were using for any methods you'd normally use there.
Another solution is:
You can call it in this way:
The
_actionController
property references the actual action controller.Use the action helper broker:
In addition to mercator's answer, add your method after, see example below: