Jquery中文网 www.jquerycn.cn
Jquery中文网 >  脚本编程  >  php  >  正文 smarty缓存应用与清除

smarty缓存应用与清除

发布时间:2015-01-10   编辑:www.jquerycn.cn
一、Smarty缓存的配置<br /> $smarty-&gt;cache_dir = &quot;/caches/&quot;; //缓存目录<br /> $smarty-&gt;caching = true; //开启缓存,为flase的时侯缓存无效<br /> $smarty-&gt;cache_lifetime = 60; //缓

一、Smarty缓存的配置
$smarty->cache_dir = "/caches/"; //缓存目录
$smarty->caching = true; //开启缓存,为flase的时侯缓存无效
$smarty->cache_lifetime = 60; //缓存时间

二、 Smarty缓存的使用和清除
$smarty->display('cache.tpl', cache_id); //创建带ID的缓存
$smarty->clear_all_cache(); //清除所有缓存
$smarty->clear_cache('index.htm'); //清除index.tpl的缓存
$smarty->clear_cache('index.htm',cache_id); //清除指定id的缓存

您可能感兴趣的文章:
smarty缓存应用与清除
PHP模板引擎Smarty缓存使用
有关smarty缓存的应用
smarty获得当前url示例代码
有关smarty的基本设置
php Smarty的缓存操作
smarty结合xajax检测用户名
smarty结合xajax检测用户名简单实例
细说php生成静态文件之模板与缓存
smarty 模板if else使用实例与入门教程

关键词: smarty  缓存   
[关闭]