FormConfigInterface
in
The configuration of a {@link Form} object.
Tags
Table of Contents
Methods
- getAction() : string
- Returns the target URL of the form.
- getAttribute() : mixed
- Returns the value of the given attribute.
- getAttributes() : array<string|int, mixed>
- Returns additional attributes of the form.
- getAutoInitialize() : bool
- Returns whether the form should be initialized upon creation.
- getByReference() : bool
- Returns whether the form's data should be modified by reference.
- getCompound() : bool
- Returns whether the form is compound.
- getData() : mixed
- Returns the initial data of the form.
- getDataClass() : string|null
- Returns the class of the view data or null if the data is scalar or an array.
- getDataLocked() : bool
- Returns whether the form's data is locked.
- getDataMapper() : DataMapperInterface|null
- Returns the data mapper of the compound form or null for a simple form.
- getDisabled() : bool
- Returns whether the form is disabled.
- getEmptyData() : mixed
- Used when the view data is empty on submission.
- getErrorBubbling() : bool
- Returns whether errors attached to the form will bubble to its parent.
- getEventDispatcher() : EventDispatcherInterface
- Returns the event dispatcher used to dispatch form events.
- getFormFactory() : FormFactoryInterface
- Returns the form factory used for creating new forms.
- getInheritData() : bool
- Returns whether the form should read and write the data of its parent.
- getIsEmptyCallback() : callable|null
- Returns a callable that takes the model data as argument and that returns if it is empty or not.
- getMapped() : bool
- Returns whether the form should be mapped to an element of its parent's data.
- getMethod() : string
- Returns the HTTP method used by the form.
- getModelTransformers() : array<string|int, DataTransformerInterface>
- Returns the model transformers of the form.
- getName() : string
- Returns the name of the form used as HTTP parameter.
- getOption() : mixed
- Returns the value of a specific option.
- getOptions() : array<string, mixed>
- Returns all options passed during the construction of the form.
- getPropertyPath() : PropertyPathInterface|null
- Returns the property path that the form should be mapped to.
- getRequestHandler() : RequestHandlerInterface
- Returns the request handler used by the form.
- getRequired() : bool
- Returns whether the form is required.
- getType() : ResolvedFormTypeInterface
- Returns the resolved form type used to construct the form.
- getViewTransformers() : array<string|int, DataTransformerInterface>
- Returns the view transformers of the form.
- hasAttribute() : bool
- Returns whether the attribute with the given name exists.
- hasOption() : bool
- Returns whether a specific option exists.
Methods
getAction()
Returns the target URL of the form.
public
getAction() : string
Return values
stringgetAttribute()
Returns the value of the given attribute.
public
getAttribute(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getAttributes()
Returns additional attributes of the form.
public
getAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>getAutoInitialize()
Returns whether the form should be initialized upon creation.
public
getAutoInitialize() : bool
Return values
boolgetByReference()
Returns whether the form's data should be modified by reference.
public
getByReference() : bool
Return values
boolgetCompound()
Returns whether the form is compound.
public
getCompound() : bool
This property is independent of whether the form actually has children. A form can be compound and have no children at all, like for example an empty collection form. The contrary is not possible, a form which is not compound cannot have any children.
Return values
boolgetData()
Returns the initial data of the form.
public
getData() : mixed
getDataClass()
Returns the class of the view data or null if the data is scalar or an array.
public
getDataClass() : string|null
Return values
string|nullgetDataLocked()
Returns whether the form's data is locked.
public
getDataLocked() : bool
A form with locked data is restricted to the data passed in this configuration. The data can only be modified then by submitting the form.
Return values
boolgetDataMapper()
Returns the data mapper of the compound form or null for a simple form.
public
getDataMapper() : DataMapperInterface|null
Return values
DataMapperInterface|nullgetDisabled()
Returns whether the form is disabled.
public
getDisabled() : bool
Return values
boolgetEmptyData()
Used when the view data is empty on submission.
public
getEmptyData() : mixed
When the form is compound it will also be used to map the children data.
The empty data must match the view format as it will passed to the first view transformer's "reverseTransform" method.
getErrorBubbling()
Returns whether errors attached to the form will bubble to its parent.
public
getErrorBubbling() : bool
Return values
boolgetEventDispatcher()
Returns the event dispatcher used to dispatch form events.
public
getEventDispatcher() : EventDispatcherInterface
Return values
EventDispatcherInterfacegetFormFactory()
Returns the form factory used for creating new forms.
public
getFormFactory() : FormFactoryInterface
Return values
FormFactoryInterfacegetInheritData()
Returns whether the form should read and write the data of its parent.
public
getInheritData() : bool
Return values
boolgetIsEmptyCallback()
Returns a callable that takes the model data as argument and that returns if it is empty or not.
public
getIsEmptyCallback() : callable|null
Return values
callable|nullgetMapped()
Returns whether the form should be mapped to an element of its parent's data.
public
getMapped() : bool
Return values
boolgetMethod()
Returns the HTTP method used by the form.
public
getMethod() : string
Return values
stringgetModelTransformers()
Returns the model transformers of the form.
public
getModelTransformers() : array<string|int, DataTransformerInterface>
Return values
array<string|int, DataTransformerInterface>getName()
Returns the name of the form used as HTTP parameter.
public
getName() : string
Return values
stringgetOption()
Returns the value of a specific option.
public
getOption(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getOptions()
Returns all options passed during the construction of the form.
public
getOptions() : array<string, mixed>
Return values
array<string, mixed> —The passed options
getPropertyPath()
Returns the property path that the form should be mapped to.
public
getPropertyPath() : PropertyPathInterface|null
Return values
PropertyPathInterface|nullgetRequestHandler()
Returns the request handler used by the form.
public
getRequestHandler() : RequestHandlerInterface
Return values
RequestHandlerInterfacegetRequired()
Returns whether the form is required.
public
getRequired() : bool
Return values
boolgetType()
Returns the resolved form type used to construct the form.
public
getType() : ResolvedFormTypeInterface
Return values
ResolvedFormTypeInterfacegetViewTransformers()
Returns the view transformers of the form.
public
getViewTransformers() : array<string|int, DataTransformerInterface>
Return values
array<string|int, DataTransformerInterface>hasAttribute()
Returns whether the attribute with the given name exists.
public
hasAttribute(string $name) : bool
Parameters
- $name : string
Return values
boolhasOption()
Returns whether a specific option exists.
public
hasOption(string $name) : bool
Parameters
- $name : string