我有一个名为mainBody与表单模板:播放框架模板没有HTML类型
@(title: String)(html: Html, moreScripts: Html = Html(""))
我能够把这个像
views.html.mainBody("All properties")(views.html.showProperties(list))
views.html.showProperties()是另一个模板。我的印象是模板只是返回Html的函数。但是,如果我延长这:
views.html.mainBody("All properties")(views.html.showProperties(list), views.html.showPropertiesScripts)
哪里views.html.showPropertiesScripts只是一些HTML代码模板,我得到的错误:
play.PlayExceptions$CompilationException: Compilation error[type mismatch;
found : views.html.showPropertiesScripts.type
required: play.twirl.api.Html]
at play.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) ~[na:na]
at play.PlayExceptions$CompilationException$.apply(PlayExceptions.scala:27) ~[na:na]
at scala.Option.map(Option.scala:145) ~[scala-library-2.11.2.jar:na]
at play.PlayReloader$$anon$1$$anonfun$play$PlayReloader$$anon$$taskFailureHandler$1.apply(PlayReloader.scala:234) ~[na:na]
at play.PlayReloader$$anon$1$$anonfun$play$PlayReloader$$anon$$taskFailureHandler$1.apply(PlayReloader.scala:229) ~[na:na]
我不明白这一点。而不是预期的类型Html,views.html.showPropertiesScripts是views.html.showPropertiesScripts.type?这是什么,为什么views.html.showPropertiesScripts不是Html(就像我的其他模板)?
2014-10-09
Mike