webpy模版嵌套官网原文摘录

Including / nesting templates


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:

print render.foo(render.bar())
or (to make things a little more clear):

barhtml = render.bar()
print render.foo(barhtml)
Then in the template foo.html:

$def with (bar)
html goes here
$:bar
more html

你可能感兴趣的:(webpy模版嵌套官网原文摘录)