From 9fd0dcedaaaabda38df6feab36639ef477eb93a0 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Tue, 1 Apr 2014 13:15:51 +0400 Subject: [PATCH] Extracted render method to allow custom renderers by subclassing --- framework/web/ViewAction.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/framework/web/ViewAction.php b/framework/web/ViewAction.php index 67e721d39b..db143af56f 100644 --- a/framework/web/ViewAction.php +++ b/framework/web/ViewAction.php @@ -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 */