webpy模版嵌套官网原文摘录

2016-04-01  本文已影响0人  ae9a4962f69a

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

上一篇 下一篇

猜你喜欢

热点阅读