Extracted render method to allow custom renderers by subclassing

This commit is contained in:
Alexander Makarov
2014-04-01 13:15:51 +04:00
parent a4be5bc910
commit 9fd0dcedaa

View File

@@ -74,7 +74,7 @@ class ViewAction extends Action
}
try {
return $this->controller->render($viewPath);
return $this->render($viewPath);
} catch (InvalidParamException $e) {
if (YII_DEBUG) {
throw new NotFoundHttpException($e->getMessage());
@@ -86,6 +86,17 @@ class ViewAction extends Action
}
}
/**
* Renders a view
*
* @param string $viewPath view path
* @return string result of the rendering
*/
protected function render($viewPath)
{
return $this->controller->render($viewPath);
}
/**
* @inheritdoc
*/