php - 在 PHP Smarty 模板引擎上禁用缓存?

标签 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;

最佳答案

如果您希望 smarty 检查,每次使用模板时,是否存在新版本(如果是,则重新编译),那么您可能正在寻找 $compile_check选项。


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

This forces Smarty to (re)compile templates on every invocation.

关于php - 在 PHP Smarty 模板引擎上禁用缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3271610/

相关文章:

php - Smarty 切割字符串以添加点

php - 从 smarty 访问 PHP 文件的变量(本地或全局)

php - 我应该在哪里发送 POST 请求?

php - 如何在动态加载 jquery 内容时生成可添加书签的 URL?

PHP:读取远程文件(最好使用 fopen)

php - 截断了不正确的 DOUBLE 值

Php:如何计算 zip 的 Adler32 校验和?

php - JS 代码中出现 smarty 错误

php - Smarty 有国际化/翻译解决方案吗?

php - <body> 标签 & script 标签和 link 标签下方的空白区域位于 head 标签的 body 标签下方