我尝试使用以下命令分配var
并对其进行翻译,但失败了。
{assign var="figcaption" value="{l s='Free Migration or Installation' mod='twittercard'}"}
当我尝试使用smarty var {$figcaption}
现在,我得到一个空字符串。
{capture}用于将模板在标签之间的输出收集到一个变量中,而不是显示它。{capture name='foo'}和{/capture}之间的任何内容都被收集到name属性中指定的变量中。
{capture name="figcaption"}{l s="Free Migration or Installation" mod="twittercard"}{/capture}
{$smarty.capture.figcaption}
使用http://www.smarty.net/docs/en/language.function.capture.tpl