|
|
@ -211,15 +211,16 @@ class Application extends Module |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function runController($route, $params = array()) |
|
|
|
public function runController($route, $params = array()) |
|
|
|
{ |
|
|
|
{ |
|
|
|
$result = $this->createController($route); |
|
|
|
list($controller, $action) = explode('/', $route); |
|
|
|
if ($result === false) { |
|
|
|
|
|
|
|
|
|
|
|
$controllerObject = $this->createController($controller, $this); |
|
|
|
|
|
|
|
if ($controllerObject === 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; |
|
|
|
} |
|
|
|
} |
|
|
|