的問題是關於Zend Framework的路由器的setDispatched()方法...setDispatched()澄清
我有一個fooAction()
,並在同一個控制器(在indexController的)一個loginAction()
。
我也有一個ActionHelper
,我使用它的preDispatch()
方法。在這個函數結束時,我有一個if
聲明,我檢查ACL:
public function preDispatch() {
// some code...
if (!$this->_acl->isAllowed($role, $resource, $privilege)) {
$request->setModuleName('default');
$request->setControllerName('index');
$request->setActionName('login');
$request->setDispatched(false); //what does this mean exactly??
}
}
所以,當我想達到fooAction()
,並且用戶還沒有得到許可,我設定的動作名稱爲「登錄'...
現在我的問題是:$request->setDispatched(false);
是什麼意思?
這是否表明,ZF可以開始派遣在loginAction(),因爲它尚未出動(setDispatched(假);)?