【问题标题】:smarty concatanate a var from a file and a normal smarty one in the smarty include sectionsmarty 连接文件中的 var 和 smarty 包含部分中的普通 smarty
【发布时间】:2013-08-29 02:37:30
【问题描述】:

您好,我正在尝试评估文件中的变量和普通变量,但似乎比看起来要难:

这行得通:

{config_load file="archive_page.conf"
section="profile"} {include file="header.tpl" title=#pageTitle# keywords=#keywords# description=#description#}

我还想使用我的 var 并将文本连接在一起,所以下面的方法也不起作用,我也尝试了 ''、"" 的变体,但会导致错误消息或变量之一显示为文本。 ..

{config_load file="archive_page.conf"
section="profile"} {include file="header.tpl" title=#pageTitle#$MYVARHERE keywords=#keywords# description=#description#}

我尝试了各种方法,但无法正常工作,非常感谢任何帮助。

【问题讨论】:

    标签: smarty smarty3 smarty2


    【解决方案1】:

    使用cat variable modifier:

    title=#pageTitle#|cat:$MYVARHERE
    

    【讨论】:

      猜你喜欢
      • 2014-03-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多