如何禁用Yii2 basic的bootstrap?

时间:2018-05-21 08:42:32

标签: yii2 yii2-basic-app

我从yiisoft/yii2-bootstrap删除了composer.json并更新了编辑器,从bootstrap删除了assets/AppAsset.php,但仍然加载了bootstrap CSS和JS! 当我从布局中删除<?php $this->head() ?>时,CSS无法加载,但bootstrap.js已加载!

如何从Yii2基本应用程序中删除所有引导程序资产?

1 个答案:

答案 0 :(得分:1)

web.php中添加此代码

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

    ],
],

并在AppAsset.php中删除此行

public $depends = [
   'yii\web\YiiAsset',              #REMOVE
   'yii\bootstrap\BootstrapAsset',  #REMOVE
];