如文档中所述,http://securesocial.ws/guide/views-customization.html我创建了一个CustomTemplatesPlugin,它扩展了TemplatesPlugin并实现了getLoginPage函数
@Override
public Html getLoginPage(Request arg0,
Form> arg1, Option arg2) {
//Logger.info(" In getLoginPage");
return views.Registration.html.login(arg1,arg2);
}
我已经在 View 下创建了一个名为Registration的文件夹,然后将login.scala.html文件从securesocial复制到了该文件夹中。
when I tried to access localhost:9000/login, I received a not found: value requestheader error, so I modified the first line in login.scala.html to
@(loginForm:play.api.data.Form[(String,String)],
> errorMsg: Option[String] = None)(implicit request:
> play.api.mvc.RequestHeader)
之后,我在浏览器中再次尝试。现在列出了以下错误。
not found: value provider
In E:\playtest\ss\app\views\Registration\login.scala.html at line 40.
37
@Messages("securesocial.login.instructions")
38
39 @for(p <- externalProviders) {
40 @provider(p.id)
}
}
在尝试自定义 View 之前,请让我知道要完成的步骤。
默认模板流程运行正常,没有问题,我正在使用play 2.1.0
谢谢
最佳答案
默认模板使用provider.scala.html文件。将其也复制到您的应用程序中,@ provider将起作用。
关于playframework - Securesocial View 定制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15848333/