禁用PHP Smarty模板引擎上的缓存?

Rob*_*Rob 7 php smarty

出于某种原因,我无法让Smarty停止缓存模板,这在我在开发过程中对模板进行更改时非常烦人.有人可以告诉我在禁用所有缓存时我出错了吗?:

$smarty                 =   new Smarty();
$smarty->template_dir   =   SMARTY_PATH."/templates";
$smarty->compile_dir    =   SMARTY_PATH."/templates_c";
$smarty->cache_dir      =   SMARTY_PATH."/cache";
$smarty->config_dir     =   SMARTY_PATH."/configs";
$smarty->cache_lifetime = 1;
$smarty->caching = 0;
Run Code Online (Sandbox Code Playgroud)

Pas*_*TIN 9

如果您想要智能检查,每次使用模板时,如果存在新版本(并且如果是这种情况则重新编译它),那么您可能正在寻找该$compile_check选项.


在开发过程中,您可能也对此感兴趣:( 引用):$force_compile

这迫使Smarty在每次调用时(重新)编译模板.