diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index 93d11e7..ee3bae0 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -35,6 +35,7 @@ Yii Framework 2 Change Log - Enh #3222: Added `useTablePrefix` option to the model generator for Gii (horizons2) - Enh #3230: Added `yii\filters\AccessControl::user` to support access control with different actors (qiangxue) - Enh #3252: Added support for case insensitive matching using ILIKE to PostgreSQL QueryBuilder (cebe) +- Enh #3298: Supported configuring `View::theme` using a class name (netyum, qiangxue) - Enh: Added support for using sub-queries when building a DB query with `IN` condition (qiangxue) - Enh: Supported adding a new response formatter without the need to reconfigure existing formatters (qiangxue) - Enh: Added `yii\web\UrlManager::addRules()` to simplify adding new URL rules (qiangxue) diff --git a/framework/base/View.php b/framework/base/View.php index 800b1f6..6dd8d43 100644 --- a/framework/base/View.php +++ b/framework/base/View.php @@ -72,7 +72,7 @@ class View extends Component */ public $defaultExtension = 'php'; /** - * @var Theme|array the theme object or the configuration array for creating the theme object. + * @var Theme|array|string the theme object or the configuration for creating the theme object. * If not set, it means theming is not enabled. */ public $theme; @@ -114,6 +114,8 @@ class View extends Component $this->theme['class'] = 'yii\base\Theme'; } $this->theme = Yii::createObject($this->theme); + } elseif (is_string($this->theme)) { + $this->theme = Yii::createObject($this->theme); } }