Browse Source

Fixes #3298: Supported configuring `View::theme` using a class name

tags/2.0.0-rc
Qiang Xue 11 years ago
parent
commit
5b6e79dc14
  1. 1
      framework/CHANGELOG.md
  2. 4
      framework/base/View.php

1
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)

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

Loading…
Cancel
Save