PHP  Yii清理缓存的实现方法

本文实例讲述了Yii清理缓存的方法。分享给大家供大家参考,具体如下:

html:

<button onclick="clearCache()">ClearCache</button>

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();
}



感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!