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:

enter image description here

  • debug in smarti turn on what shows? - Naumov
  • I am only working on this project, so I was not the one doing the assembly. there is no debug.tpl file in the project ( smarty.net/docsv2/ru/chapter.debugging.console.tpl ) ... - Anque
  • Okay, try copying the page from a variable into assign into a template) - Naumov
  • I did not understand how to do it :) I cannot assign anything to assign anything, this is a method - Anque

1 answer 1

 $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