3
我有下面的代码,如果它存在,我想包括一个模板,否则回退到输出内容。Smarty + Prestashop:包含模板(如果存在的话)
{if $smarty->template_exists("$tpl_dir./cms.tpl")}
{include file="$tpl_dir/$cms->link_rewrite.tpl"}
{ else }
{$cms->content}
{ /if }
据我了解,我的语法是正确的,但我可能是错的,因为我是新手。任何想法我做错了(我想也许连接)?
使用同样的方法在'{包括文件= ....}' – klimpond