Reputation: 86
I am begin to learn Yii2 and installed Advanced version. Add extensions. Configure application and load to server. After sometime I noticed that Yii save the assets cache to directory web/assets. But is logical use this directory for real assets. Because I use Twig web/assets uses for js and css files. And I start search how to change assets cache directory, but not found this. Exist several questions on stackoverflow about like themes, but answer was not found. Yii2 save ti this dir cache of bootstrap, jquery and any assets.
How to change this directory to web/cache?
Upvotes: 0
Views: 1815
Reputation: 3893
You can configure the assets directory using the basePath and baseUrl properties of the Asset Manager. There's is a description in the documentation. you can do this in your config file, so
return [
// ...
'components' => [
'assetManager' => [
'baseUrl' => 'your/url',
'basePath => 'your/path'
],
],
];
Upvotes: 1