smarty block 功能实现 局部缓存

来源:互联网 发布:java文件夹选择器 编辑:程序博客网 时间:2024/06/04 18:20

HTML部分

{nocache}  {**some process**}  {/nocache} 

nocache就是自定义block实现区块内数据的控制

function smarty_block_nocache($param, $content, $smarty)   {      return $content;  }  $smarty->register_block('nocache', 'smarty_block_nocache', false);

register_block

void register_block(string name, mixed impl, bool cacheable, array or nullcache_attrs);

原创粉丝点击