【问题标题】:How can one pass a non-string parameter between page and master templates?如何在页面和主模板之间传递非字符串参数?
【发布时间】:2011-11-08 18:05:51
【问题描述】:

这不应该工作:

页面:

#{extends 'master.html'/}
#{set parameter:foo.bar/} //foo is passed from contoller

master.html:

#{list items:parameter, as item}
 ... 
#{/list}

有没有办法做到这一点?

【问题讨论】:

    标签: playframework template-engine


    【解决方案1】:

    我不得不尝试一下,但 #{set} 标记不适用于列表。在你的页面中试试这个(不是 master.html):

    %{ parameter = foo.bar; }%
    

    希望对您有所帮助。

    【讨论】:

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