Commit 77e0be5c by Qiang Xue

Merge branch 'master' of git.yiisoft.com:yii2

Conflicts: framework/base/Application.php
parents ceac41b2 a6961f34
......@@ -216,11 +216,10 @@ class Application extends Module
if ($result === false) {
throw new InvalidRequestException(Yii::t('yii', 'Unable to resolve the request.'));
}
/** @var $controller Controller */
list($controller, $action) = $result;
$priorController = $this->controller;
$this->controller = $controller;
$status = $controller->run($action, $params);
$this->controller = $controllerObject;
$status = $controllerObject->run($action, $params);
$this->controller = $priorController;
return $status;
}
......
......@@ -142,8 +142,9 @@ class Controller extends Component
if ($actionID === '') {
$actionID = $this->defaultAction;
}
if (isset($this->actionMap[$actionID])) {
return \Yii::createObject($this->actionMap[$actionID], $actionID, $this);
$actions = $this->actions();
if (isset($actions[$actionID])) {
return \Yii::createObject($actions[$actionID], $actionID, $this);
} elseif (method_exists($this, 'action' . $actionID)) {
return new InlineAction($actionID, $this);
} else {
......
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