码迷,mamicode.com
首页 > 其他好文 > 详细

ci文件缓存使用,可以用来实现多模板切换

时间:2015-02-28 16:23:00      阅读:300      评论:0      收藏:0      [点我收藏+]

标签:


//2015年2月28日15:13:41

$this
->load->driver(‘cache‘, array(‘adapter‘ => ‘file‘));//加载适配器
//请注意,最好用新版本
$tpl=‘default‘;

$this->cache->file->save(‘template‘, $tpl, 999);
$this->cache->file->save(‘存的文件名或者叫ID‘, ‘存进去的值‘, ‘存在的时间‘);
//写一个竟可能大的时间可以表示无线
$template =$this->cache->get(‘template‘);//获取template的值
$this->cache->delete(‘template‘);//删除template的缓存文件
var_dump($this->cache->cache_info());//获取所有缓存的文件的详细信息
$this->cache->clean();//删除所有的缓存的文件
var_dump($this->cache->get_metadata(‘template‘));//获取template的缓存的详细信息
也可以用来缓存微信缓存7200秒的key

a:3:{s:4:"time";i:1425107444;s:3:"ttl";i:
999;s:4:"data";s:7:"default";}
 


 

ci文件缓存使用,可以用来实现多模板切换

标签:

原文地址:http://www.cnblogs.com/zx-admin/p/4305544.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!