Yii2 automatically generates the assets in web folder. How can we change it to any other folder?
For example. If I create a folder named myassets
in web folder. It is possible to store all the assets in this folder?
You can change it by editing $basePath of AssetManager.
Through application config:
'assetManager' => [
'basePath' => '@webroot/my-assets',
],
Through application component:
\Yii:$app->assetManager->basePath = '@webroot/my-assets';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With