Browse Source

minor code refacotring.

tags/2.0.0-beta
Qiang Xue 11 years ago
parent
commit
e4299afac1
  1. 4
      framework/yii/base/View.php

4
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);

Loading…
Cancel
Save