怎么设置网站的某一个页面不使用smarty缓存

WBOY
发布: 2016-06-13 10:59:14
原创
812 人浏览过

如何设置网站的某一个页面不使用smarty缓存
如何设置网站的某一个页面不使用smarty缓存
------最佳解决方案--------------------
在对应的页面使用smarty的对象修改caching属性为false
例如
$smarty->caching = false;
------其他解决方案--------------------
一样的嘛,你还不是要继承Action类
然后在实现的地方 用 $this->_tpl->caching = false;
------其他解决方案--------------------
我是使用mvc模式,在控制器基类进行了统一设置
class Action{
  public $_tpl;

  function __construct(){
$this->_tpl = new smarty;
$this->_tpl->template_dir   = 'view/templates';
$this->_tpl->compile_dir    = 'view/templates_c';
$this->_tpl->cache_dir      = 'view/cache';
$this->_tpl->config_dir     = 'view/config';
$this->_tpl->cache_lifetime = '3600';
$this->_tpl->caching        = true;  
                $this->_tpl->assign('st',$this->_tpl);
  }
  

}

相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责声明 Sitemap
PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!