CDN how to include

Hi, I just want to ask ,how can I include this in Appasset ?


Thank you in advance.

I’m not sure you can but I don’t see what the value of doing that would be. The asset system is designed around publishing local assets and is helpful for bundling assets with a module or otherwise to program dependencies but in the case of CDN, I would just link them as usual.

Look into and the source code for AssetManager to see whether it can resolve external URLs.

In AppAsset.php, add your library to the $js property

I got this directly from Yii2’s documentation