如何在页面模板和主模板之间传递非字符串参数? [英] How can one pass a non-string parameter between page and master templates?
本文介绍了如何在页面模板和主模板之间传递非字符串参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这不起作用:
页面:
#{extends 'master.html'/}
#{set parameter:foo.bar/} //foo is passed from contoller
master.html:
master.html:
#{list items:parameter, as item}
...
#{/list}
有什么办法可以做到这一点?
Is there any way to do this trick?
推荐答案
我不得不对此稍作练习,但是#{set}标记不适用于列表.在您的页面(不是master.html)中尝试此操作:
I had to play with this a bit, but the #{set} tag does not work well for lists. Try this in your page (not master.html):
%{ parameter = foo.bar; }%
希望有帮助.
这篇关于如何在页面模板和主模板之间传递非字符串参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文