use include in tpl files with smarty in prestashop modules
The smarty version included in prestashop seems to be slightly different than the offical release.
If you want to use the include instruction in a tpl file, you have to be aware of these limitations inside the instruction:
If you want to use the include instruction in a tpl file, you have to be aware of these limitations inside the instruction:
- you cannot concat strings
- you must use full path
// Get the full path of the mytpl template [...] $smarty->assign('one_var', dirname(__FILE__).'/mytpl.tpl'); return $this->display(__FILE__, $this->name.'.tpl');And the following code in your .tpl file:
[...] {include file=$one_var} [...]
Comments