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?
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';