开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜