怎么设置网站的某一个页面不使用smarty缓存
Jun 13, 2016 am 10:59 AM
如何设置网站的某一个页面不使用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);
}
}

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Solution: Your organization requires you to change your PIN

How to adjust window border settings on Windows 11: Change color and size

How to change title bar color on Windows 11?

How to enable or disable taskbar thumbnail previews on Windows 11

OOBELANGUAGE Error Problems in Windows 11/10 Repair

What are the differences between Huawei GT3 Pro and GT4?

10 Ways to Adjust Brightness on Windows 11
