mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-13 12:49:04 +08:00
Extracted render method to allow custom renderers by subclassing
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user