webpy模版嵌套官网原文摘录

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,562评论 5 6
  • afinalAfinal是一个android的ioc,orm框架 https://github.com/yangf...
    passiontim阅读 15,585评论 2 45
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,010评论 19 139
  • 你以为我有释道忍受委屈,顺应现实的消极思想,并为我的这个变化而悲哀。这是误会。我并没有顺应鄙俗的环境,同流合污,放...
    衎宬主人阅读 210评论 8 1
  • 在时空里穿梭,我们看见不同时空的彼此。 见面后的2分钟,所有感受都齐全了, 一切尽在不言中, 那还有什么好说的吗?...
    9444e0643fbd阅读 48评论 0 0