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

Implementation method of clearing cache in PHP Yii

高洛峰
高洛峰Original
2016-12-30 17:01:041636browse

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:

0e44e95a56a88b3861172243a4127e41ClearCache65281c5ac262bf6d81768915a4a77ac0

js:

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

php:

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

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!

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