フロントコントローラー用のプラグインがあります。
dispatcherloodstartup メソッドでは問題なく動作しますが、postdispatcher はアクションを呼び出すことができません!
なにが問題ですか?
これは私のプラグインです:
class Places_Controller_Plugin_ActionSetup extends Zend_Controller_Plugin_Abstract
{
public function dispatchLoopStartup( Zend_Controller_Request_Abstract $request)
{
$front = Zend_Controller_Front::getInstance();
if (!$front->hasPlugin('Zend_Controller_Plugin_ActionStack')) {
$actionStack = new Zend_Controller_Plugin_ActionStack();
$front->registerPlugin($actionStack, 97);
} else {
$actionStack = $front->getPlugin('Zend_Controller_Plugin_ActionStack');
}
$menuAction = clone($request);
$menuAction->setActionName('menu')->setControllerName('index');
$actionStack->pushStack($menuAction);
}
public function postDispatch(Zend_Controller_Request_Abstract $request)
{ $menuAction = clone($request);
$menuAction->setActionName('toolbar')->setControllerName('index');
}
}
これは私のブートストラップコードです:
$frontController->registerPlugin(new Places_Controller_Plugin_ActionSetup(), 98);
stackpush を使用する必要がある場合、どの番号が役立ちますか?