我的控制器中有一个 SinupForm,我将其传递给注册视图
对象 SignUpController 扩展控制器 {
private val signUpForm = Form(
tuple(
"email" -> nonEmptyText.verifying(
"email already exists",
emailString => Accounts.findBy(emailString).isEmpty),
"full_name" -> nonEmptyText,
"password" -> text(minLength = 6)
))
def signup = Action {
Ok(views.html.signup(signUpForm))
}
}
因为我是 Play 框架的新手,所以我很困惑。假设一次有 10 个请求进行注册,在这种情况下,我是否需要将单独的表单实例传递给每个请求?