FormFactory
in package
implements
FormFactoryInterface
Interfaces, Classes, Traits and Enums
- FormFactoryInterface
- Allows creating a form based on a name, a class or a property.
Table of Contents
- $registry : mixed
- __construct() : mixed
- create() : FormInterface
- Returns a form.
- createBuilder() : FormBuilderInterface
- Returns a form builder.
- createBuilderForProperty() : FormBuilderInterface
- Returns a form builder for a property of a class.
- createForProperty() : FormInterface
- Returns a form for a property of a class.
- createNamed() : FormInterface
- Returns a form.
- createNamedBuilder() : FormBuilderInterface
- Returns a form builder.
Properties
$registry
private
mixed
$registry
Methods
__construct()
public
__construct(FormRegistryInterface $registry) : mixed
Parameters
- $registry : FormRegistryInterface
Return values
mixed —create()
Returns a form.
public
create([mixed $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormInterface
Parameters
- $type : mixed = FormType::class
-
The type of the form
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormInterface —The form named after the type
createBuilder()
Returns a form builder.
public
createBuilder([mixed $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormBuilderInterface
Parameters
- $type : mixed = FormType::class
-
The type of the form
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormBuilderInterface —The form builder
createBuilderForProperty()
Returns a form builder for a property of a class.
public
createBuilderForProperty(mixed $class, mixed $property[, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormBuilderInterface
Parameters
- $class : mixed
-
The fully qualified class name
- $property : mixed
-
The name of the property to guess for
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormBuilderInterface —The form builder named after the property
createForProperty()
Returns a form for a property of a class.
public
createForProperty(mixed $class, mixed $property[, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormInterface
Parameters
- $class : mixed
-
The fully qualified class name
- $property : mixed
-
The name of the property to guess for
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormInterface —The form named after the property
createNamed()
Returns a form.
public
createNamed(mixed $name[, mixed $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormInterface
Parameters
- $name : mixed
-
The name of the form
- $type : mixed = FormType::class
-
The type of the form
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormInterface —The form
createNamedBuilder()
Returns a form builder.
public
createNamedBuilder(mixed $name[, mixed $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormBuilderInterface
Parameters
- $name : mixed
-
The name of the form
- $type : mixed = FormType::class
-
The type of the form
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormBuilderInterface —The form builder