欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Yii清理緩存的方法

 更新時(shí)間:2016年01月06日 11:39:46   作者:yuhui_fish  
這篇文章主要介紹了Yii清理緩存的方法,涉及Yii結(jié)合jQuery的ajax調(diào)用實(shí)現(xiàn)清理緩存功能,代碼簡(jiǎn)單實(shí)用,需要的朋友可以參考下

本文實(shí)例講述了Yii清理緩存的方法。分享給大家供大家參考,具體如下:

html:

復(fù)制代碼 代碼如下:
<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();
}

希望本文所述對(duì)大家基于Yii框架的PHP程序設(shè)計(jì)有所幫助。

相關(guān)文章

最新評(píng)論