scala 中的播放框架表单验证的工作遵循我的 Signup 对象,它在“mapping(”:“缺少对象表单中的方法映射的参数;如果你想将其视为此方法,请使用“_”)部分应用函数"
case class UserRegistration(username: String, password1: String, password2: String)
val loginForm = Form(
mapping(
"username" -> email,
"password1" -> text,
"password2" -> text
)
(UserRegistration.apply)(UserRegistration.unapply)
verifying ("Passwords must match", => f.password1 == f.password2)
)