Commit 0cce7684 by Alexander Makarov

Removed ViewAction::afterRun()

parent 9fd0dced
......@@ -55,11 +55,6 @@ class ViewAction extends Action
public $layout;
/**
* @var string Used to store controller layout during executin and then restore it
*/
private $_controllerLayout;
/**
* Runs the action.
* This method displays the view requested by the user.
* @throws NotFoundHttpException if the view file cannot be found
......@@ -68,13 +63,14 @@ class ViewAction extends Action
{
$viewPath = $this->getViewPath();
$controllerLayout = null;
if($this->layout !== null) {
$this->_controllerLayout = $this->controller->layout;
$controllerLayout = $this->controller->layout;
$this->controller->layout = $this->layout;
}
try {
return $this->render($viewPath);
$output = $this->render($viewPath);
} catch (InvalidParamException $e) {
if (YII_DEBUG) {
throw new NotFoundHttpException($e->getMessage());
......@@ -84,6 +80,12 @@ class ViewAction extends Action
);
}
}
if ($controllerLayout) {
$this->controller->layout = $controllerLayout;
}
return $output;
}
/**
......@@ -98,17 +100,6 @@ class ViewAction extends Action
}
/**
* @inheritdoc
*/
protected function afterRun()
{
if ($this->layout !== null) {
$this->controller->layout = $this->_controllerLayout;
}
parent::afterRun();
}
/**
* Obtain view path from GET
*
* @return string view path
......
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