Browse Source

Fixes #1323: Added View::defaultExtension.

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

6
framework/yii/base/View.php

@ -65,6 +65,10 @@ class View extends Component
*/
public $renderers;
/**
* @var string the default view file extension. This will be appended to view file names if they don't have file extensions.
*/
public $defaultExtension = '.php';
/**
* @var Theme|array the theme object or the configuration array for creating the theme object.
* If not set, it means theming is not enabled.
*/
@ -167,7 +171,7 @@ class View extends Component
}
}
return pathinfo($file, PATHINFO_EXTENSION) === '' ? $file . '.php' : $file;
return pathinfo($file, PATHINFO_EXTENSION) === '' ? $file . $this->defaultExtension : $file;
}
/**

Loading…
Cancel
Save