适用方法的参数太多

时间:2016-04-03 17:53:06

标签: scala playframework playframework-2.2

我在Scala中做了一个Play应用程序,当我想打开我的应用程序时收到此错误:

  

方法适用的参数太多:(标题:字符串)(内容:play.twirl.api.Html)(隐含消息:play.api.i18n.Messages)play.twirl.api.HtmlFormat.Appendable in class main

我不知道我的代码有什么问题,这里是我的代码的快速视图:

main.scala.html:

@(title: String )(content: Html)(implicit messages: Messages)
<!DOCTYPE html>
    <html>
          <head>
                <title>@title</title>
                <link rel="stylesheet" media="screen" href="@routes.Assets.at("stylesheets/main.css")">
          </head>

这里是viewseleves.scala.html

@(eleves: Seq[Eleve])(implicit flash: Flash, messages: Messages)
@main(messages("title.eleves"), Some("viewEleves")){
  <div id="type_ead" class="list">
    <fieldset>
      <legend>@messages("institutions.list.institutions")</legend>

错误屏幕:

error

1 个答案:

答案 0 :(得分:2)

在这一行:

@main(messages("title.eleves"), Some("viewEleves"))

您已将两个参数传递给模板创建的主要功能,但它只需要一个String名为title