From e4299afac1b017662f454cb7b48776b8ae995db3 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Fri, 25 Oct 2013 20:33:16 -0400 Subject: [PATCH] minor code refacotring. --- framework/yii/base/View.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/yii/base/View.php b/framework/yii/base/View.php index 68b1094..57f2fc1 100644 --- a/framework/yii/base/View.php +++ b/framework/yii/base/View.php @@ -259,16 +259,16 @@ class View extends Component $output = ''; if ($this->beforeRender($viewFile)) { + Yii::trace("Rendering view file: $viewFile", __METHOD__); $ext = pathinfo($viewFile, PATHINFO_EXTENSION); if (isset($this->renderers[$ext])) { - if (is_array($this->renderers[$ext])) { + if (is_array($this->renderers[$ext]) || is_string($this->renders[$ext])) { $this->renderers[$ext] = Yii::createObject($this->renderers[$ext]); } /** @var ViewRenderer $renderer */ $renderer = $this->renderers[$ext]; $output = $renderer->render($this, $viewFile, $params); } else { - Yii::trace("Rendering view file: $viewFile", __METHOD__); $output = $this->renderPhpFile($viewFile, $params); } $this->afterRender($viewFile, $output);