W
W
wolfcruel972019-03-20 16:40:33
Yii
wolfcruel97, 2019-03-20 16:40:33

Yii2 enables boostrap after redirect, how to disable it?

yii2 includes boostrap.css after redirect, how to disable it? If you just refresh the page they are not there.

<?php

namespace frontend\assets;

use yii\web\AssetBundle;

/**
 * Main frontend application asset bundle.
 */
class AppAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/style.min.css',
        'css/common.css'
    ];
    public $js = [
        'js/popper/popper.min.js',
        'js/bootstrap/dist/js/bootstrap.min.js',
        'js/perfect-scrollbar.jquery.min.js',
        'js/waves.js',
        'js/sidebarmenu.js',
        'js/sticky-kit-master/dist/sticky-kit.min.js',
        'js/sparkline/jquery.sparkline.min.js',
        'js/custom.js',
        'js/jquery-sparkline/jquery.sparkline.min.js'
    ];
    public $depends = [];
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2019-03-20
@wolfcruel97

can be disabled in config

'assetManager' => [
            'bundles' => [
                'yii\bootstrap\BootstrapPluginAsset' => [
                    'js'=>[]
                ],
                'yii\bootstrap\BootstrapAsset' => [
                    'css' => [],
                ],
            ],
        ],

But I think that this behavior is a consequence of some kind of problem and it is worth finding it. After the redirect, you should not connect anything anywhere, unless of course the redirect goes to another page with other assets

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question