Home >Backend Development >PHP Tutorial >How to clear cache of Yii2 assets

How to clear cache of Yii2 assets

不言
不言Original
2018-05-03 15:43:372318browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn