N
N
nepster-web2014-07-09 01:04:24
Yii
nepster-web, 2014-07-09 01:04:24

Why is Bootstrap disabled when any widget is connected?

I need to include Bootstrap.js on every page of the site:

public $depends = [
        'yii\web\JqueryAsset',
        'yii\bootstrap\BootstrapAsset'
        
    ];
        
    public function init()
    {
        parent::init();
        // resetting BootstrapAsset to not load own css files
        Yii::$app->assetManager->bundles['yii\\bootstrap\\BootstrapAsset'] = [
            'js' => ['js/bootstrap.min.js']
        ];
    }

Everything works, everything is fine. But I noticed such a moment when I include any widget that uses js styles, then js/bootstrap.min.js disappears from the page. Please tell me what is the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nepster-web, 2014-07-10
@nepster-web

Solved by connecting BootstrapPluginAsset

public $depends = [
            //'yii\web\JqueryAsset',
            //'yii\bootstrap\BootstrapAsset'
            'yii\bootstrap\BootstrapPluginAsset'
        ];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question