PHP Yii清理缓存的实现方法
PHP Yii清理缓存的实现方法
本文实例讲述了Yii清理缓存的方法。分享给大家供大家参考,具体如下:
html:
<buttononclick="clearCache()">ClearCache</button>
js:
functionclearCache()
{
$.get('../eng/index.php?r=site/clear&'+newDate().getTime(),function(){
alert('Clearengcacheok.');
});
}
php:
publicfunctionactionClear()
{
Yii::app()->cache->flush();
}
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!