Commit f1ba923e by Qiang Xue

Fixes #648: EVENT_BEFORE_ACTION is triggered twice.

parent 6f4e2c9b
...@@ -115,7 +115,7 @@ class Controller extends Component ...@@ -115,7 +115,7 @@ class Controller extends Component
$this->action = $action; $this->action = $action;
$result = null; $result = null;
$event = new ActionEvent($action); $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)) { if ($event->isValid && $this->module->beforeAction($action) && $this->beforeAction($action)) {
$result = $action->runWithParams($params); $result = $action->runWithParams($params);
$this->afterAction($action, $result); $this->afterAction($action, $result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment