Browse Source

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

Conflicts:
	framework/base/Application.php
tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
77e0be5c69
  1. 7
      framework/base/Application.php
  2. 5
      framework/base/Controller.php

7
framework/base/Application.php

@ -216,11 +216,10 @@ class Application extends Module
if ($result === false) { if ($result === false) {
throw new InvalidRequestException(Yii::t('yii', 'Unable to resolve the request.')); throw new InvalidRequestException(Yii::t('yii', 'Unable to resolve the request.'));
} }
/** @var $controller Controller */
list($controller, $action) = $result;
$priorController = $this->controller; $priorController = $this->controller;
$this->controller = $controller; $this->controller = $controllerObject;
$status = $controller->run($action, $params); $status = $controllerObject->run($action, $params);
$this->controller = $priorController; $this->controller = $priorController;
return $status; return $status;
} }

5
framework/base/Controller.php

@ -142,8 +142,9 @@ class Controller extends Component
if ($actionID === '') { if ($actionID === '') {
$actionID = $this->defaultAction; $actionID = $this->defaultAction;
} }
if (isset($this->actionMap[$actionID])) { $actions = $this->actions();
return \Yii::createObject($this->actionMap[$actionID], $actionID, $this); if (isset($actions[$actionID])) {
return \Yii::createObject($actions[$actionID], $actionID, $this);
} elseif (method_exists($this, 'action' . $actionID)) { } elseif (method_exists($this, 'action' . $actionID)) {
return new InlineAction($actionID, $this); return new InlineAction($actionID, $this);
} else { } else {

Loading…
Cancel
Save