This article mainly introduces the method of clearing the cache of Yii2 assets, involving function calls and configuration skills related to assets in Yii. Friends in need can refer to the following
The example of this article describes the method of clearing the cache of Yii2 assets. Share it with everyone for your reference, the details are as follows:
use vendor\myVendorName\myPackageName\assets\AppAsset; AppAsset::register($this);
Add in the configuration file:
'components' => [ 'assetManager' => [ 'linkAssets' => true, ], ]
You can clear the cache after refreshing
Related recommendations:
Yii2 framework data verification operation example detailed explanation
Yii2 framework class Example analysis of automatic loading mechanism
The above is the detailed content of How to clear cache of Yii2 assets. For more information, please follow other related articles on the PHP Chinese website!