Heim  >  Artikel  >  Backend-Entwicklung  >  yii 为何无法禁用加载bootstrap.js这个文件?

yii 为何无法禁用加载bootstrap.js这个文件?

WBOY
WBOYOriginal
2016-06-06 20:17:091405Durchsuche

在配置文件中配置了

<code>'assetManager' => [
            'bundles' => [
                'yii\bootstrap\BootstrapAsset'=>false
            ]

        ],</code>

结果依然会加载bootstrap.js这个文件(bootstrap.css这个文件并没有加载),不知道是怎么回事?
yii 为何无法禁用加载bootstrap.js这个文件?

更新:bootstrap.js在yii\bootstrap\BootstrapPluginAsset这个资源包中,因此该禁用yii\bootstrap\BootstrapPluginAsset。

回复内容:

在配置文件中配置了

<code>'assetManager' => [
            'bundles' => [
                'yii\bootstrap\BootstrapAsset'=>false
            ]

        ],</code>

结果依然会加载bootstrap.js这个文件(bootstrap.css这个文件并没有加载),不知道是怎么回事?
yii 为何无法禁用加载bootstrap.js这个文件?

更新:bootstrap.js在yii\bootstrap\BootstrapPluginAsset这个资源包中,因此该禁用yii\bootstrap\BootstrapPluginAsset。

app/assets/AppAsset.php

<code>    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
    ];</code>

注释下试试亲。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn