Could we have a yii\web\AssetBundle::unregister class method?

Hi,

As far as I know, this functionality doesn’t exist and I have come across a scenario where it would be useful (extending a class where assets are registered and where I have already compiled those assets using gulp/sass). I think it would be cleaner than having to set the asset bundle to FALSE in the app config.

Thanks,

U4EA

Hi U4EA

Insert piece of code in views/layouts/main.php to unregister the yii\web\AssetBundle


unset($this->assetBundles['app\assets\AppAsset']);

Or use this in config/main.php file inside components


'assetManager' =>

    'bundles' => [

        'yii\web\AssetBundle' => false,

    ],