smarty缓存的应用
来源:互联网 发布:bizhub7622 连接端口 编辑:程序博客网 时间:2024/09/21 09:02
1、Smarty缓存的配置,这些内容要加到配置文件中
$smarty->cache_dir = "/caches/"; //缓存目录
$smarty->caching = true; //开启缓存,为flase的时侯缓存无效
$smarty->cache_lifetime = 60; //缓存时间
2、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的缓存
3、Smarty局部缓存
insert 函数默认是不缓存的。并且这个属性不能修改。
index.htm
<div>{insert name="get_time"}</div>
index.php
function insert_get_time(){
return date("Y-m-d H:m:s");
smarty_block 函数功能更加强大,使用方法同上
{blockname}
没有缓存的:{$smarty.now}
{/blockname}
- smarty缓存的应用
- Smarty的缓存与应用
- smarty变量调节器补充,缓存的应用
- Smarty-案例(缓存的应用(1))
- Smarty-案例(缓存的应用(2))
- Smarty-案例(缓存的应用(3))
- Smarty-案例(缓存的应用(4))
- Smarty-案例(缓存的应用(5))
- Smarty-案例(缓存的应用(6))
- php文件缓存smarty模板的应用
- smarty缓存功能的开启y应用
- Smarty模板缓存应用
- 关于smarty配置、变量、缓存、数组的基本应用
- Smarty的缓存操作
- Smarty缓存的学习
- smarty缓存的删除
- smarty的局部缓存
- PHP模板引擎Smarty缓存应用
- show status说明
- [转载]不靠谱的软件开发工期预估
- 检查是否含有中文-判断字符是否是中文字符(C#版本,js版本)
- VC/MFC中使用RichEdit 要注意的地方
- CSDN所给予的
- smarty缓存的应用
- VB实现获取字节的任意位状态查询
- hdu 2199 二分解方程
- 关于 NOP 指令 汇编
- Ubuntu 安装Postgres数据库,Windows 安装PgAdmin进行远程管理,Django远程连接 手记
- adb devices显示no permissions
- 十六进制颜色码
- 网游加速器的工作原理
- asp加密