我试图使用以下方法来分配一个var并将翻译放到它上,但是失败了。
{assign var="figcaption" value="{l s='Free Migration or Installation' mod='twittercard'}"}当我现在尝试使用智能var {$figcaption}时,我得到了一个空字符串。
发布于 2016-07-05 08:50:05
{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
https://stackoverflow.com/questions/38195112
复制相似问题