Commit 5743d482 by Alexander Kochetov

A little yii\bootstrap classes refactoring

parent a954312a
...@@ -77,7 +77,6 @@ class Alert extends Widget ...@@ -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";
......
...@@ -102,7 +102,6 @@ class Modal extends Widget ...@@ -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";
......
...@@ -68,7 +68,6 @@ class TypeAhead extends Widget ...@@ -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');
} }
......
...@@ -67,6 +67,7 @@ class Widget extends \yii\base\Widget ...@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment