Asset feature refactoring (WIP)

This commit is contained in:
Qiang Xue
2013-07-15 22:49:22 -04:00
parent dc2843a2d7
commit 368a4cfe66
67 changed files with 820 additions and 338 deletions

View File

@ -65,8 +65,14 @@ class Widget extends \yii\base\Widget
{
$id = $this->options['id'];
$view = $this->getView();
$view->registerAssetBundle(static::$responsive ? 'yii/bootstrap/responsive' : 'yii/bootstrap');
$view->registerAssetBundle("yii/bootstrap/$name");
if (self::$responsive) {
ResponsiveAsset::register($view);
} else {
BootstrapAsset::register($view);
}
/** @var \yii\web\AssetBundle $assetClass */
$assetClass = 'yii\bootstrap\\' . ucfirst($name);
$assetClass::register($view);
if ($this->clientOptions !== false) {
$options = empty($this->clientOptions) ? '' : Json::encode($this->clientOptions);