本文实例讲述了Yii2 assets清除缓存的方法。分享给大家供大家参考,具体如下:
use vendor\myVendorName\myPackageName\assets\AppAsset;
AppAsset::register($this);
在配置文件中添加:
'components' => [
'assetManager' => [
'linkAssets' => true,
],
]
刷新后就可以清除缓存
更多关于Yii相关内容感兴趣的读者可查看本站专题:《[url=http://www.1sucai.cn/Special/386.htm]Yii框架入门及常用技巧总结[/url]》、《[url=http://www.1sucai.cn/Special/155.htm]php优秀开发框架总结[/url]》、《[url=http://www.1sucai.cn/Special/26.htm]smarty模板入门基础教程[/url]》、《[url=http://www.1sucai.cn/Special/96.htm]php日期与时间用法总结[/url]》、《[url=http://www.1sucai.cn/Special/43.htm]php面向对象程序设计入门教程[/url]》、《[url=http://www.1sucai.cn/Special/47.htm]php字符串(string)用法总结[/url]》、《[url=http://www.1sucai.cn/Special/84.htm]php+mysql数据库操作入门教程[/url]》及《[url=http://www.1sucai.cn/Special/231.htm]php常见数据库操作技巧汇总[/url]》
希望本文所述对大家基于Yii框架的PHP程序设计有所帮助。