Disabling caching on the Smarty PHP template?

For some reason, I can't get Smarty to stop caching templates, which is very annoying when I make changes to templates during development. Can someone tell me where I am going wrong by disabling all caching ?:

$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; 
+7
php smarty
source share
2 answers

If you want smarty to check every time a template is used, if a new version exists (and recompile it if so), then you are probably looking for $compile_check .


During development, you may also be interested in the following: $force_compile (citation):

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

+8
source share

default:

 var $force_compile = false; / public $force_compile = false; 

change the code above:

 var $force_compile = true; / public $force_compile = true; 
0
source share

All Articles