私は私の質問で明確にしたいと思っています!コントローラーとアクション名が_initVars()でZend Framework
_initVars()内のgetControllerName()およびgetActionName()にアクセスしたいと思います。私は、何の応答を取得していないよフィールドはコントローラ名とactionNameの空戻ってきている
protected function _initVars()
{
$this->bootstrap('layout');
$layout = $this->getResource('layout');
$view = $layout->getView();
$view->theme = 'MY_THEME';
$this->bootstrap('frontController');
$front = $this->getResource('frontController');
echo '<pre>';
print_r($front->getRequest());
echo '</pre>';
exit;
return $view;
}
、これは私がお返しに得るものです::これは私がやろうとしているものです
Zend_Controller_Front Object
(
[_baseUrl:protected] =>
[_controllerDir:protected] =>
[_dispatcher:protected] => Zend_Controller_Dispatcher_Standard Object
(
[_curDirectory:protected] =>
[_curModule:protected] => default
[_controllerDirectory:protected] => Array
(
[default] => /var/www/proj_rodrigo/application/controllers
)
[_defaultAction:protected] => index
[_defaultController:protected] => index
[_defaultModule:protected] => default
[_frontController:protected] =>
[_invokeParams:protected] => Array
(
)
にですZendの古いスキーマでは、Zend_Front_Controllerを呼び出すことができるかもしれませんが、今ではそれを使う方法は分かりません。
ありがとうございました! 私の悪い英語を大変申し訳なく思っています。この問題を解決するには
、私は私のプラグインでpostDispatcheを追加します。
パブリック関数postDispatch(Zend_Controller_Request_Abstractを継承$リクエスト) {
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$layout = $bootstrap->getResource('layout');
$view = $layout->getView();
$view->controller = $this->getRequest()->getControllerName();
$view->action = $this->getRequest()->getActionName();
}
おかげで再び!
ありがとうございました!トピックを更新しました。 –
よろしくお願いいたします。私は初期の実行プラグインの私の仮定が間違っていたと思います。あなたはそれがすべて働いてうれしいです。乾杯! –