【发布时间】:2013-04-27 19:11:57
【问题描述】:
我想在我的另一个模板中使用模板中的可重用块。我怎样才能做到这一点?更具体地说:
我有一个包含这个标签的模板 views/main.scala.html
@logo_header = {
<div id="logo-container">
...
</div>
}
我有另一个模板 views/errors/notFound.scala.html 我想在其中包含主模板中的 logo_header 标记。我尝试@main.logo_header 或@main.logo_header() 但编译总是说:
值 logo_header 不是对象 views.html.main 的成员
我查看了官方documentation 他们描述的内容,但我不明白为什么它不起作用。
【问题讨论】: