How can one pass a non-string parameter between page and master templates?

十年热恋 提交于 2019-12-22 18:21:22

问题


This shouldn't work:

page:

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

master.html:

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

Is there any way to do this trick?


回答1:


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; }%

Hope that helps.



来源:https://stackoverflow.com/questions/8055058/how-can-one-pass-a-non-string-parameter-between-page-and-master-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!