How to clear cache in Yii, how to clear cache in Yii_PHP tutorial

WBOY
Release: 2016-07-12 09:01:27
Original
1260 people have browsed it

How to clear the cache in Yii, how to clear the cache in Yii

The example in this article describes the method of clearing the cache in Yii. Share it with everyone for your reference, the details are as follows:

html:
Copy code The code is as follows:

js:

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

Copy after login

php:

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

Copy after login

I hope this article will be helpful to everyone’s PHP program design based on the Yii framework.

Articles you may be interested in:

  • How to use yii, CI, yaf framework smarty templates
  • A summary of Yii usage tips
  • Yii Quick Start Classic Tutorial
  • Summary of knowledge points for getting started with YiiFramework (picture and text tutorial)
  • Yii permission control methods (three methods)
  • php regularly deletes files in folders (clear cache files) )
  • PHP uses redis to implement statistical caching mysql pressure
  • Analysis of common caching technology examples in PHP
  • Summary of PHP 9 major caching technologies
  • ThinkPHP File caching code sharing

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1089199.htmlTechArticleYii's method of clearing cache, Yii's method of clearing cache. This article describes the method of Yii's method of clearing cache. Share it with everyone for your reference, the details are as follows: html: Copy the code The code is as follows: bu...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template