Code:
function runSmarty($tpl, $vars = array()) {
if ( !file_exists($this->tpl_path . $tpl) ) return '';
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->force_compile = true;
$smarty->use_sub_dirs = true;
$smarty->template_dir = $this->tpl_path;
$smarty->compile_dir = $this->cpl_path;
$smarty->plugins_dir = array('myplugins', 'plugins');
$smarty->request_use_auto_globals = true;
$smarty->assign('page', $this);
$smarty->assign($vars);
return $smarty->fetch($tpl);
}
function runSmarty($tpl, $vars = array()) {
if ( !file_exists($this->tpl_path . $tpl) ) return '';
$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->force_compile = true;
$smarty->use_sub_dirs = true;
$smarty->template_dir = $this->tpl_path;
$smarty->compile_dir = $this->cpl_path;
$smarty->plugins_dir = array('myplugins', 'plugins');
$smarty->request_use_auto_globals = true;
$smarty->assign('page', $this);
$smarty->assign($vars);
return $smarty->fetch($tpl);
}
problem sa ovom funkcijom je sto:
kad je iskljucen force_compile, onda nece da mi ponovo kompajlira template koji sam izmenio (bez obzira sto je compile_check uvek true)
naravno, kad je ukljucen, onda menja lepo, ali naravno, stalno kompajlira sve (sto bih hteo da izbegnem, naravno)...
Zasto ovo kod mene (u lokalu) ne radi? Gde gresim?
P.S. koristim Smarty v2.6.2 ako je to vazno...
ZelenaLutrija.com - Saznajte sve o lutriji za zelenu kartu (doživotni boravak u Sjedinjenim Američkim Državama)