Yii 清理缓存

html:

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

js:

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

php:

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

 

posted @ 2013-07-26 16:20  jshaibozhong  阅读(618)  评论(0编辑  收藏  举报