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

How to clear cache of Yii2 assets

不言
Release: 2023-03-25 09:54:01
Original
2255 people have browsed it

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);
Copy after login

Add in the configuration file:

'components' => [
  'assetManager' => [
    'linkAssets' => true,
  ],
]
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template