Home > php教程 > PHP开发 > Implementation method of clearing cache in PHP Yii

Implementation method of clearing cache in PHP Yii

高洛峰
Release: 2016-12-30 17:01:04
Original
1608 people have browsed it

PHP Yii cache clearing implementation method

The example in this article describes the Yii cache clearing method. Share it with everyone for your reference, the details are as follows:

html:


js:

function clearCache()
{
 $.get('../eng/index.php?r=site/clear&'+new Date().getTime(),function(){
  alert('Clear eng cache ok.');
 });
}
Copy after login

php:

public function actionClear()
{
 Yii::app()->cache->flush();
}
Copy after login

Thanks for reading, I hope it can help everyone , thank you all for your support of this site!

For more articles related to how to implement PHP Yii cache cleaning, please pay attention to 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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template