You need to pass a variable to the template, type
$t_inc = new TPL('.tpl/'.$page['tpl'].'/tpl/'.$page['tpl_list']); $t_inc->assign('pages', 3);
Then use it
<div id='tmp'>{$pages}</div>
But nothing is interpreted, displayed as is:
You need to pass a variable to the template, type
$t_inc = new TPL('.tpl/'.$page['tpl'].'/tpl/'.$page['tpl_list']); $t_inc->assign('pages', 3);
Then use it
<div id='tmp'>{$pages}</div>
But nothing is interpreted, displayed as is:
$smarty = new Smarty; $smarty->setCacheDir($this->cachePath); $smarty->setCompileDir($this->compiledPath); $smarty->setTemplateDir($this->templatePath); $smarty->caching = false; $smarty->compile_check = true; $smarty->assign('pages', 3); echo $smarty->fetch(dirname($this->templatePath)."/{$this->template}.tpl";);
Try it on pure smarty. It is possible that the bug is somewhere in the wrappers
Source: https://ru.stackoverflow.com/questions/549199/
All Articles