Documentation

FormFactoryInterface

Allows creating a form based on a name, a class or a property.

Tags
author

Bernhard Schussek bschussek@gmail.com

Table of Contents

Methods

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.

Methods

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> = []
Tags
see
createBuilder()
throws
InvalidOptionsException

if any given option is not applicable to the given type

Return values
FormInterface

createBuilder()

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> = []
Tags
throws
InvalidOptionsException

if any given option is not applicable to the given type

Return values
FormBuilderInterface

createBuilderForProperty()

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

If any of the 'required' and type options can be guessed, and are not provided in the options argument, the guessed value is used.

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> = []
Tags
throws
InvalidOptionsException

if any given option is not applicable to the form type

Return values
FormBuilderInterface

createForProperty()

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> = []
Tags
see
createBuilderForProperty()
throws
InvalidOptionsException

if any given option is not applicable to the form type

Return values
FormInterface

createNamed()

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> = []
Tags
see
createNamedBuilder()
throws
InvalidOptionsException

if any given option is not applicable to the given type

Return values
FormInterface

createNamedBuilder()

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> = []
Tags
throws
InvalidOptionsException

if any given option is not applicable to the given type

Return values
FormBuilderInterface

        
On this page

Search results