mediatekformation

FormBuilder extends FormConfigBuilder
in package
implements IteratorAggregate, FormBuilderInterface

A builder for creating {@link Form} instances.

Tags
author

Bernhard Schussek bschussek@gmail.com

Interfaces, Classes, Traits and Enums

IteratorAggregate
FormBuilderInterface

Table of Contents

$locked  : mixed
$action  : string|null
$attributes  : mixed
$autoInitialize  : mixed
$byReference  : mixed
$children  : array<string|int, FormBuilderInterface>
The children of the form builder.
$compound  : mixed
$data  : mixed
$dataClass  : string|null
$dataLocked  : mixed
$dataMapper  : DataMapperInterface|null
$disabled  : mixed
$dispatcher  : mixed
$emptyData  : mixed
$errorBubbling  : mixed
$formFactory  : FormFactoryInterface|null
$inheritData  : mixed
$mapped  : mixed
$method  : mixed
$modelTransformers  : mixed
$name  : mixed
$nativeRequestHandler  : NativeRequestHandler
Caches a globally unique {@link NativeRequestHandler} instance.
$options  : mixed
$propertyPath  : PropertyPathInterface|string|null
$requestHandler  : RequestHandlerInterface|null
$required  : mixed
$type  : ResolvedFormTypeInterface
$unresolvedChildren  : array<string|int, mixed>
The data of children who haven't been converted to form builders yet.
$viewTransformers  : mixed
__construct()  : mixed
Creates an empty form configuration.
add()  : self
Adds a new field to this group. A field must have a unique name within the group. Otherwise the existing field is overwritten.
addEventListener()  : $this
Adds an event listener to an event on this form.
addEventSubscriber()  : $this
Adds an event subscriber for events on this form.
addModelTransformer()  : $this
Prepends / appends a transformer to the normalization transformer chain.
addViewTransformer()  : $this
Appends / prepends a transformer to the view transformer chain.
all()  : array<string, self>
Returns the children.
count()  : int
create()  : self
Creates a form builder.
get()  : self
Returns a child by name.
getAction()  : mixed
{@inheritdoc}
getAttribute()  : mixed
{@inheritdoc}
getAttributes()  : mixed
{@inheritdoc}
getAutoInitialize()  : mixed
{@inheritdoc}
getByReference()  : mixed
{@inheritdoc}
getCompound()  : mixed
{@inheritdoc}
getData()  : mixed
{@inheritdoc}
getDataClass()  : mixed
{@inheritdoc}
getDataLocked()  : mixed
{@inheritdoc}
getDataMapper()  : mixed
{@inheritdoc}
getDisabled()  : mixed
{@inheritdoc}
getEmptyData()  : mixed
{@inheritdoc}
getErrorBubbling()  : mixed
{@inheritdoc}
getEventDispatcher()  : mixed
{@inheritdoc}
getForm()  : FormInterface
Creates the form.
getFormConfig()  : FormConfigInterface
Builds and returns the form configuration.
getFormFactory()  : mixed
{@inheritdoc}
getInheritData()  : mixed
{@inheritdoc}
getIterator()  : array<string|int, FormBuilderInterface>|Traversable
{@inheritdoc}
getMapped()  : mixed
{@inheritdoc}
getMethod()  : mixed
{@inheritdoc}
getModelTransformers()  : mixed
{@inheritdoc}
getName()  : mixed
{@inheritdoc}
getOption()  : mixed
{@inheritdoc}
getOptions()  : mixed
{@inheritdoc}
getPropertyPath()  : mixed
{@inheritdoc}
getRequestHandler()  : mixed
{@inheritdoc}
getRequired()  : mixed
{@inheritdoc}
getType()  : mixed
{@inheritdoc}
getViewTransformers()  : mixed
{@inheritdoc}
has()  : bool
Returns whether a field with the given name exists.
hasAttribute()  : mixed
{@inheritdoc}
hasOption()  : mixed
{@inheritdoc}
isValidName()  : bool
Returns whether the given variable contains a valid form name.
remove()  : self
Removes the field with the given name.
resetModelTransformers()  : $this
Clears the normalization transformers.
resetViewTransformers()  : $this
Clears the view transformers.
setAction()  : $this
Sets the target URL of the form.
setAttribute()  : $this
Sets the value for an attribute.
setAttributes()  : $this
Sets the attributes.
setAutoInitialize()  : $this
Sets whether the form should be initialized automatically.
setByReference()  : $this
Sets whether the form's data should be modified by reference.
setCompound()  : $this
Sets whether the form should be compound.
setData()  : $this
Sets the initial data of the form.
setDataLocked()  : $this
Locks the form's data to the data passed in the configuration.
setDataMapper()  : $this
Sets the data mapper used by the form.
setDisabled()  : $this
Sets whether the form is disabled.
setEmptyData()  : $this
Sets the data used for the client data when no value is submitted.
setErrorBubbling()  : $this
Sets whether errors bubble up to the parent.
setFormFactory()  : mixed
Sets the form factory used for creating new forms.
setInheritData()  : $this
Sets whether the form should read and write the data of its parent.
setMapped()  : $this
Sets whether the form should be mapped to an element of its parent's data.
setMethod()  : $this
Sets the HTTP method used by the form.
setPropertyPath()  : $this
Sets the property path that the form should be mapped to.
setRequestHandler()  : $this
Sets the request handler used by the form.
setRequired()  : $this
Sets whether this field is required to be filled out when submitted.
setType()  : $this
Sets the resolved type.
resolveChild()  : FormBuilderInterface
Converts an unresolved child into a {@link FormBuilderInterface} instance.
resolveChildren()  : mixed
Converts all unresolved children into {@link FormBuilder} instances.

Properties

$unresolvedChildren

The data of children who haven't been converted to form builders yet.

private array<string|int, mixed> $unresolvedChildren = []

Methods

add()

Adds a new field to this group. A field must have a unique name within the group. Otherwise the existing field is overwritten.

public add(mixed $child[, mixed $type = null ][, array<string|int, mixed> $options = [] ]) : self
Parameters
$child : mixed
$type : mixed = null
$options : array<string|int, mixed> = []
Return values
self

addEventListener()

Adds an event listener to an event on this form.

public addEventListener(mixed $eventName, mixed $listener, mixed $priority) : $this
Parameters
$eventName : mixed

The name of the event to listen to

$listener : mixed

The listener to execute

$priority : mixed

The priority of the listener. Listeners with a higher priority are called before listeners with a lower priority.

Return values
$this

The configuration object

addModelTransformer()

Prepends / appends a transformer to the normalization transformer chain.

public addModelTransformer(DataTransformerInterface $modelTransformer[, mixed $forceAppend = false ]) : $this
Parameters
$modelTransformer : DataTransformerInterface
$forceAppend : mixed = false

If set to true, append instead of prepending

Return values
$this

The configuration object

addViewTransformer()

Appends / prepends a transformer to the view transformer chain.

public addViewTransformer(DataTransformerInterface $viewTransformer[, mixed $forcePrepend = false ]) : $this
Parameters
$viewTransformer : DataTransformerInterface
$forcePrepend : mixed = false

If set to true, prepend instead of appending

Return values
$this

The configuration object

all()

Returns the children.

public all() : array<string, self>
Return values
array<string, self>

create()

Creates a form builder.

public create(mixed $name[, mixed $type = null ][, array<string|int, mixed> $options = [] ]) : self
Parameters
$name : mixed

The name of the form or the name of the property

$type : mixed = null

The type of the form or null if name is a property

$options : array<string|int, mixed> = []
Return values
self

get()

Returns a child by name.

public get(mixed $name) : self
Parameters
$name : mixed

The name of the child

Return values
self

getAction()

{@inheritdoc}

public getAction() : mixed
Return values
mixed

getAttribute()

{@inheritdoc}

public getAttribute(mixed $name[, mixed $default = null ]) : mixed
Parameters
$name : mixed
$default : mixed = null
Return values
mixed

getAttributes()

{@inheritdoc}

public getAttributes() : mixed
Return values
mixed

getAutoInitialize()

{@inheritdoc}

public getAutoInitialize() : mixed
Return values
mixed

getByReference()

{@inheritdoc}

public getByReference() : mixed
Return values
mixed

getCompound()

{@inheritdoc}

public getCompound() : mixed
Return values
mixed

getDataClass()

{@inheritdoc}

public getDataClass() : mixed
Return values
mixed

getDataLocked()

{@inheritdoc}

public getDataLocked() : mixed
Return values
mixed

getDataMapper()

{@inheritdoc}

public getDataMapper() : mixed
Return values
mixed

getDisabled()

{@inheritdoc}

public getDisabled() : mixed
Return values
mixed

getEmptyData()

{@inheritdoc}

public getEmptyData() : mixed
Return values
mixed

getErrorBubbling()

{@inheritdoc}

public getErrorBubbling() : mixed
Return values
mixed

getEventDispatcher()

{@inheritdoc}

public getEventDispatcher() : mixed
Return values
mixed

getFormFactory()

{@inheritdoc}

public getFormFactory() : mixed
Return values
mixed

getInheritData()

{@inheritdoc}

public getInheritData() : mixed
Return values
mixed

getMapped()

{@inheritdoc}

public getMapped() : mixed
Return values
mixed

getMethod()

{@inheritdoc}

public getMethod() : mixed
Return values
mixed

getModelTransformers()

{@inheritdoc}

public getModelTransformers() : mixed
Return values
mixed

getOption()

{@inheritdoc}

public getOption(mixed $name[, mixed $default = null ]) : mixed
Parameters
$name : mixed
$default : mixed = null
Return values
mixed

getOptions()

{@inheritdoc}

public getOptions() : mixed
Return values
mixed

getPropertyPath()

{@inheritdoc}

public getPropertyPath() : mixed
Return values
mixed

getRequestHandler()

{@inheritdoc}

public getRequestHandler() : mixed
Return values
mixed

getRequired()

{@inheritdoc}

public getRequired() : mixed
Return values
mixed

getViewTransformers()

{@inheritdoc}

public getViewTransformers() : mixed
Return values
mixed

has()

Returns whether a field with the given name exists.

public has(mixed $name) : bool
Parameters
$name : mixed
Return values
bool

hasAttribute()

{@inheritdoc}

public hasAttribute(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

hasOption()

{@inheritdoc}

public hasOption(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

isValidName()

Returns whether the given variable contains a valid form name.

public static isValidName(string|null $name) : bool

A name is accepted if it

  • is empty
  • starts with a letter, digit or underscore
  • contains only letters, digits, numbers, underscores ("_"), hyphens ("-") and colons (":")
Parameters
$name : string|null
Tags
final

since Symfony 4.4

Return values
bool

remove()

Removes the field with the given name.

public remove(mixed $name) : self
Parameters
$name : mixed
Return values
self

resetModelTransformers()

Clears the normalization transformers.

public resetModelTransformers() : $this
Return values
$this

The configuration object

resetViewTransformers()

Clears the view transformers.

public resetViewTransformers() : $this
Return values
$this

The configuration object

setAction()

Sets the target URL of the form.

public setAction(mixed $action) : $this
Parameters
$action : mixed

The target URL of the form

Return values
$this

The configuration object

setAttribute()

Sets the value for an attribute.

public setAttribute(mixed $name, mixed $value) : $this
Parameters
$name : mixed

The name of the attribute

$value : mixed

The value of the attribute

Return values
$this

The configuration object

setAttributes()

Sets the attributes.

public setAttributes(array<string|int, mixed> $attributes) : $this
Parameters
$attributes : array<string|int, mixed>
Return values
$this

The configuration object

setAutoInitialize()

Sets whether the form should be initialized automatically.

public setAutoInitialize(mixed $initialize) : $this
Parameters
$initialize : mixed

True to initialize the form automatically, false to suppress automatic initialization. In the second case, you need to call manually.

Return values
$this

The configuration object

setByReference()

Sets whether the form's data should be modified by reference.

public setByReference(mixed $byReference) : $this
Parameters
$byReference : mixed

Whether the data should be modified by reference

Return values
$this

The configuration object

setCompound()

Sets whether the form should be compound.

public setCompound(mixed $compound) : $this
Parameters
$compound : mixed

Whether the form should be compound

Return values
$this

The configuration object

setData()

Sets the initial data of the form.

public setData(mixed $data) : $this
Parameters
$data : mixed

The data of the form in model format

Return values
$this

The configuration object

setDataLocked()

Locks the form's data to the data passed in the configuration.

public setDataLocked(mixed $locked) : $this
Parameters
$locked : mixed

Whether to lock the default configured data

Return values
$this

The configuration object

setDisabled()

Sets whether the form is disabled.

public setDisabled(mixed $disabled) : $this
Parameters
$disabled : mixed

Whether the form is disabled

Return values
$this

The configuration object

setEmptyData()

Sets the data used for the client data when no value is submitted.

public setEmptyData(mixed $emptyData) : $this
Parameters
$emptyData : mixed

The empty data

Return values
$this

The configuration object

setErrorBubbling()

Sets whether errors bubble up to the parent.

public setErrorBubbling(mixed $errorBubbling) : $this
Parameters
$errorBubbling : mixed
Return values
$this

The configuration object

setInheritData()

Sets whether the form should read and write the data of its parent.

public setInheritData(mixed $inheritData) : $this
Parameters
$inheritData : mixed

Whether the form should inherit its parent's data

Return values
$this

The configuration object

setMapped()

Sets whether the form should be mapped to an element of its parent's data.

public setMapped(mixed $mapped) : $this
Parameters
$mapped : mixed

Whether the form should be mapped

Return values
$this

The configuration object

setMethod()

Sets the HTTP method used by the form.

public setMethod(mixed $method) : $this
Parameters
$method : mixed

The HTTP method of the form

Return values
$this

The configuration object

setPropertyPath()

Sets the property path that the form should be mapped to.

public setPropertyPath(mixed $propertyPath) : $this
Parameters
$propertyPath : mixed

The property path or null if the path should be set automatically based on the form's name

Return values
$this

The configuration object

setRequired()

Sets whether this field is required to be filled out when submitted.

public setRequired(mixed $required) : $this
Parameters
$required : mixed
Return values
$this

The configuration object

resolveChildren()

Converts all unresolved children into {@link FormBuilder} instances.

private resolveChildren() : mixed
Return values
mixed

Search results