How to extend/replace default action helper in Zend Framework
I need to override Zend_Controller_Action_Helper_Redictor method redirectAndExit().
I create My_Controller_Action_Helper_Redirector and put file with class in the right place. How to force ZF to us开发者_JAVA百科e My_Controller_Action_Helper_Redirector instead Zend_Controller_Action_Helper_Redirector?
Check out Zend_Controller_Action_HelperBroker. In your bootstrap file try this:
public function _initActionHelpers()
{
$this->bootstrap('frontController')
Zend_Controller_Action_HelperBroker::addHelper($myHelperClass);
}
If you override the getName() behaviour your helper should be called if you refer to the redirector.
精彩评论