美文网首页
webpy模版嵌套官网原文摘录

webpy模版嵌套官网原文摘录

作者: ae9a4962f69a | 来源:发表于2016-04-01 23:37 被阅读0次

Including / nesting templates

<br />If you want to nest one template within another, you nest the render() calls, and then include the variable (unfiltered) in the page. In your handler:
<br />print render.foo(render.bar())
or (to make things a little more clear):
<br />barhtml = render.bar()
print render.foo(barhtml)
Then in the template foo.html:
<br />$def with (bar)
html goes here
$:bar
more html

相关文章

网友评论

      本文标题:webpy模版嵌套官网原文摘录

      本文链接:https://www.haomeiwen.com/subject/csvylttx.html