【发布时间】:2011-07-29 05:24:32
【问题描述】:
我有类似的东西
<?php
class AccountController extends Zend_Controller_Action
{
public function init()
{
if(!Zend_Auth::getInstance()->hasIdentity()) {
//need to forward to the auth action in another controller,
//instead of dispatching to whatever action it would be dispatched to
}
}
...
我不能使用 $this->_forward("action") 因为身份验证操作不在同一个控制器中,并且在 init 中,转发必须针对同一个控制器中的操作。有什么想法吗?
$request->setModuleName('module')
->setControllerName('controller')
->setActionName('action');
也不行。我已尝试清除参数,但仍然一无所获。
【问题讨论】:
标签: model-view-controller zend-framework routing controller dispatcher