Form

play.api.data.Form
See theForm companion class
object Form

Provides a set of operations for creating Form values.

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Form.type

Members list

Type members

Inherited and Abstract types

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def apply[T](mapping: Mapping[T]): Form[T]

Creates a new form from a mapping.

Creates a new form from a mapping.

For example:

import play.api.data._
import play.api.data.Forms._
import play.api.data.format.Formats._

val userForm = Form(
 tuple(
   "name" -> of[String],
   "age" -> of[Int],
   "email" -> of[String]
 )
)

Value parameters

mapping

the form mapping

Attributes

Returns

a form definition

def apply[T](mapping: (String, Mapping[T])): Form[T]

Creates a new form from a mapping, with a root key.

Creates a new form from a mapping, with a root key.

For example:

import play.api.data._
import play.api.data.Forms._
import play.api.data.format.Formats._

val userForm = Form(
 "user" -> tuple(
   "name" -> of[String],
   "age" -> of[Int],
   "email" -> of[String]
 )
)

Value parameters

mapping

the root key, form mapping association

Attributes

Returns

a form definition

Concrete fields

INTERNAL API

INTERNAL API

Default maximum number of chars allowed to be used in the intermediate map representation of the JSON. Defaults to 100k which is the default of parser.maxMemoryBuffer

Attributes

INTERNAL API

INTERNAL API

Default maximum depth of objects and arrays supported in JSON forms

Attributes