From f1ba923e91584f9fd2ec978845b7b8f8a4e7f293 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Sun, 21 Jul 2013 20:39:05 -0400 Subject: [PATCH] Fixes #648: EVENT_BEFORE_ACTION is triggered twice. --- framework/yii/base/Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/yii/base/Controller.php b/framework/yii/base/Controller.php index c0c5f2f..2f77b8e 100644 --- a/framework/yii/base/Controller.php +++ b/framework/yii/base/Controller.php @@ -115,7 +115,7 @@ class Controller extends Component $this->action = $action; $result = null; $event = new ActionEvent($action); - $this->trigger(Application::EVENT_BEFORE_ACTION, $event); + Yii::$app->trigger(Application::EVENT_BEFORE_ACTION, $event); if ($event->isValid && $this->module->beforeAction($action) && $this->beforeAction($action)) { $result = $action->runWithParams($params); $this->afterAction($action, $result);