Yii2 disable asset of a vendor module

﹥>﹥吖頭↗ 提交于 2019-12-20 01:46:18

问题


I have installed yii2-admin module, located in /vendor/mdmsoft/yii2-admin but I don't want it to load its own asset bundle. It there any way to disable this module asset bundle?


回答1:


Yes, it's possible and even mentioned in official docs here. One way to do it is through application config:

return [
    // ...
    'components' => [
        'assetManager' => [
            'bundles' => [
                'mdm\admin\AdminAsset' => false,
            ],
        ],
    ],
];

Another way - during runtime through component:

\Yii::$app->assetManager->bundles['mdm\admin\AdminAsset'] = false;


来源:https://stackoverflow.com/questions/30472821/yii2-disable-asset-of-a-vendor-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!