我正在执行动作助手的preDispatch方法中的ACL检查。当它失败时,我想调用操作控制器的_redirect方法,但是我很难做到这一点。Zend Framework - 如何从动作助手内部调用controller的重定向()
在附加到这篇文章的评论中,我看到了两个解决方案:zend-framework, call an action helper from within another action helper。在第一个中,控制器是通过$ this - > _ actionController从助手中访问的。在第二个中,它使用$ this-> getActionController()来访问。
我尝试以下两个:
$this->_actionController->_redirect('/');
$this->getActionController()->_redirect('/');
在这两种情况下,我得到“方法‘_redirect’不存在......”。是否可以限制哪些控制器方法可以从动作助手访问?