Browse Source

Merge pull request #348 from creocoder/bootstrap-fixes

A little yii\bootstrap\* classes refactoring
tags/2.0.0-beta
Qiang Xue 12 years ago
parent
commit
4e347d700c
  1. 1
      framework/yii/bootstrap/Alert.php
  2. 1
      framework/yii/bootstrap/Modal.php
  3. 1
      framework/yii/bootstrap/TypeAhead.php
  4. 1
      framework/yii/bootstrap/Widget.php

1
framework/yii/bootstrap/Alert.php

@ -77,7 +77,6 @@ class Alert extends Widget
{ {
parent::init(); parent::init();
$this->getView()->registerAssetBundle('yii/bootstrap/alert');
$this->initOptions(); $this->initOptions();
echo Html::beginTag('div', $this->options) . "\n"; echo Html::beginTag('div', $this->options) . "\n";

1
framework/yii/bootstrap/Modal.php

@ -102,7 +102,6 @@ class Modal extends Widget
{ {
parent::init(); parent::init();
$this->getView()->registerAssetBundle('yii/bootstrap/modal');
$this->initOptions(); $this->initOptions();
echo $this->renderToggleButton() . "\n"; echo $this->renderToggleButton() . "\n";

1
framework/yii/bootstrap/TypeAhead.php

@ -68,7 +68,6 @@ class TypeAhead extends Widget
*/ */
public function run() public function run()
{ {
$this->getView()->registerAssetBundle('yii/bootstrap/typeahead');
echo $this->renderField(); echo $this->renderField();
$this->registerPlugin('typeahead'); $this->registerPlugin('typeahead');
} }

1
framework/yii/bootstrap/Widget.php

@ -67,6 +67,7 @@ class Widget extends \yii\base\Widget
$id = $this->options['id']; $id = $this->options['id'];
$view = $this->getView(); $view = $this->getView();
$view->registerAssetBundle(static::$responsive ? 'yii/bootstrap/responsive' : 'yii/bootstrap'); $view->registerAssetBundle(static::$responsive ? 'yii/bootstrap/responsive' : 'yii/bootstrap');
$view->registerAssetBundle("yii/bootstrap/$name");
if ($this->pluginOptions !== false) { if ($this->pluginOptions !== false) {
$options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions); $options = empty($this->pluginOptions) ? '' : Json::encode($this->pluginOptions);

Loading…
Cancel
Save