【发布时间】:2011-04-04 02:46:18
【问题描述】:
我正在 Action Helper 的 preDispatch 方法中进行 ACL 检查。当它失败时,我想调用动作控制器的 _redirect 方法但是我很难做到这一点。
在本文所附的 cmets zend-framework, call an action helper from within another action helper 中,我看到了两种解决方案。首先,控制器通过 $this->_actionController 的帮助程序访问。在第二种情况下,使用 $this->getActionController() 访问它。
我尝试了以下两种方法:
$this->_actionController->_redirect('/');
$this->getActionController()->_redirect('/');
在任何一种情况下,我都会得到'方法“_redirect”不存在......'。从动作助手访问哪些控制器方法可能存在限制?
【问题讨论】:
标签: php zend-framework