FormFactory
in package
implements
FormFactoryInterface
Table of Contents
Interfaces
- FormFactoryInterface
- Allows creating a form based on a name, a class or a property.
Properties
- $registry : mixed
Methods
- __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
create()
Returns a form.
public
create([string $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormInterface
Parameters
- $type : string = FormType::class
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormInterfacecreateBuilder()
Returns a form builder.
public
createBuilder([string $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormBuilderInterface
Parameters
- $type : string = FormType::class
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormBuilderInterfacecreateBuilderForProperty()
Returns a form builder for a property of a class.
public
createBuilderForProperty(string $class, string $property[, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormBuilderInterface
Parameters
- $class : string
-
The fully qualified class name
- $property : string
-
The name of the property to guess for
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormBuilderInterfacecreateForProperty()
Returns a form for a property of a class.
public
createForProperty(string $class, string $property[, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormInterface
Parameters
- $class : string
-
The fully qualified class name
- $property : string
-
The name of the property to guess for
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormInterfacecreateNamed()
Returns a form.
public
createNamed(string $name[, string $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormInterface
Parameters
- $name : string
- $type : string = FormType::class
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []
Return values
FormInterfacecreateNamedBuilder()
Returns a form builder.
public
createNamedBuilder(string $name[, string $type = FormType::class ][, mixed $data = null ][, array<string|int, mixed> $options = [] ]) : FormBuilderInterface
Parameters
- $name : string
- $type : string = FormType::class
- $data : mixed = null
-
The initial data
- $options : array<string|int, mixed> = []