当前位置:首页 > PHP教程 > 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();
}

希望本文所述对大家基于yii框架的php程序设计有所帮助。


【说明】本文章由站长整理发布,文章内容不代表本站观点,如文中有侵权行为,请与本站客服联系(QQ:)!