smarty缓存总结
来源:互联网 发布:怎么安装spss软件 编辑:程序博客网 时间:2024/06/06 19:03
Smarty中的缓存
1、 一个页面一个缓存
2、 一个页面多个缓存(分页)
3、 局部关闭缓存(实时性)
缓存的目的:
PHP文件:解决功能上的问题(M+C)
提供数据
HTML文件:界面效果(V)
缓存的配置步骤:
1) 配置文件中开启缓存
$tpl->caching=2
缓存时间(秒)
缓存目录
2)$tpl->display(“index.tpl”);
相当于把(编译后的文件产生的)静态页面只保留一份;
$tpl->display(“index.tpl”,名称);
相当于把(编译后的文件产生的)静态页面根据名称保留多份;
例如:$tpl->display(“index.tpl”,1);
$tpl->display(“index.tpl”,$_GET[‘page’]);
$tpl->display(“index.tpl”,$_SERVER[‘REQUSET_URI’]);
3) 登陆用户名、时间日期等实时性要求比较高需要关闭缓存
l <{insert }> 关闭缓存
*.php
Function insert_XXX(){}
*.tpl
<{insert name=XXX assign=XXX}>
l 写插件
./plugins/block.XXX.php
Function smary_block_XXX(){}
编辑Smarty_compiler.class.php文件
712行
true---false
if($tag_command==XXX){。。。。。。false}
else{ 。。。。。。。。。。。。。。。。。。。。。。。true}
l 自定义函数
*.php
Function XXXX(){}
$tpl->register_block(“”,””,false)
模板文件
<{XXX}> <{$DATE}> <{XXX}>
- smarty总结之缓存
- smarty缓存总结
- php smarty 缓存总结
- smarty总结及局部缓存
- 缓存总结 SMARTY新闻管理系统分析
- php+smarty ,smarty 缓存
- smarty缓存
- smarty缓存
- smarty缓存
- smarty缓存
- smarty缓存
- Smarty缓存
- smarty缓存
- smarty缓存
- smarty缓存
- smarty缓存
- smarty 缓存
- smarty缓存
- 鱼相忘于江湖,人相忘于道术
- Ubuntu 搭建PHP开发环境
- JSON是什么?它能带来什么?
- Install, Configure and Run Dynamips in Windows 7
- 或许在你的意料之外(一)
- smarty缓存总结
- URL取值传值
- PostgreSQL代码整体结构(二)
- Windows下使用Vim和CSCOPE搭建C/C++ IDE和源代码浏览器的步骤
- 如何设置gdb的调试代码查找目录
- linux 调试技术
- VC6 转 VS2008
- 关于Oracle10g二进制参数文件损坏不能启动Oracle实例的解决方法
- WPF中判断键盘按下Ctrl+Z的判断方法