Commit c9a7119b by Qiang Xue

Fixes issue #467: allow view file to be absent as long as the themed version exists.

parent d0ba90c1
...@@ -235,10 +235,10 @@ class View extends Component ...@@ -235,10 +235,10 @@ class View extends Component
public function renderFile($viewFile, $params = array(), $context = null) public function renderFile($viewFile, $params = array(), $context = null)
{ {
$viewFile = Yii::getAlias($viewFile); $viewFile = Yii::getAlias($viewFile);
if (is_file($viewFile)) {
if ($this->theme !== null) { if ($this->theme !== null) {
$viewFile = $this->theme->applyTo($viewFile); $viewFile = $this->theme->applyTo($viewFile);
} }
if (is_file($viewFile)) {
$viewFile = FileHelper::localize($viewFile); $viewFile = FileHelper::localize($viewFile);
} else { } else {
throw new InvalidParamException("The view file does not exist: $viewFile"); throw new InvalidParamException("The view file does not exist: $viewFile");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment