interface FormConfigInterface

The configuration of a {@link Form} object.

Methods

getEventDispatcher()

Returns the event dispatcher used to dispatch form events.

string
getName()

Returns the name of the form used as HTTP parameter.

PropertyPathInterface|null
getPropertyPath()

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

bool
getMapped()

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

bool
getByReference()

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

bool
getInheritData()

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

bool
getCompound()

Returns whether the form is compound.

getType()

Returns the resolved form type used to construct the form.

array
getViewTransformers()

Returns the view transformers of the form.

array
getModelTransformers()

Returns the model transformers of the form.

DataMapperInterface|null
getDataMapper()

Returns the data mapper of the compound form or null for a simple form.

bool
getRequired()

Returns whether the form is required.

bool
getDisabled()

Returns whether the form is disabled.

bool
getErrorBubbling()

Returns whether errors attached to the form will bubble to its parent.

mixed
getEmptyData()

Used when the view data is empty on submission.

array
getAttributes()

Returns additional attributes of the form.

bool
hasAttribute(string$name)

Returns whether the attribute with the given name exists.

mixed
getAttribute(string$name,mixed$default =null)

Returns the value of the given attribute.

mixed
getData()

Returns the initial data of the form.

string|null
getDataClass()

Returns the class of the view data or null if the data is scalar or an array.

bool
getDataLocked()

Returns whether the form's data is locked.

getFormFactory()

Returns the form factory used for creating new forms.

string
getAction()

Returns the target URL of the form.

string
getMethod()

Returns the HTTP method used by the form.

getRequestHandler()

Returns the request handler used by the form.

bool
getAutoInitialize()

Returns whether the form should be initialized upon creation.

array
getOptions()

Returns all options passed during the construction of the form.

bool
hasOption(string$name)

Returns whether a specific option exists.

mixed
getOption(string$name,mixed$default =null)

Returns the value of a specific option.

callable|null
getIsEmptyCallback()

Returns a callable that takes the model data as argument and that returns if it is empty or not.

Details

EventDispatcherInterface getEventDispatcher()

Returns the event dispatcher used to dispatch form events.

string getName()

Returns the name of the form used as HTTP parameter.

Return Value

string

PropertyPathInterface|null getPropertyPath()

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

Return Value

PropertyPathInterface|null

bool getMapped()

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

Return Value

bool

bool getByReference()

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

Return Value

bool

bool getInheritData()

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

Return Value

bool

bool getCompound()

Returns whether the form is compound.

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 Value

bool

ResolvedFormTypeInterface getType()

Returns the resolved form type used to construct the form.

array getViewTransformers()

Returns the view transformers of the form.

Return Value

array

array getModelTransformers()

Returns the model transformers of the form.

Return Value

array

DataMapperInterface|null getDataMapper()

Returns the data mapper of the compound form or null for a simple form.

Return Value

DataMapperInterface|null

bool getRequired()

Returns whether the form is required.

Return Value

bool

bool getDisabled()

Returns whether the form is disabled.

Return Value

bool

bool getErrorBubbling()

Returns whether errors attached to the form will bubble to its parent.

Return Value

bool

mixed getEmptyData()

Used when the view data is empty on submission.

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.

Return Value

mixed

array getAttributes()

Returns additional attributes of the form.

Return Value

array

bool hasAttribute(string$name)

Returns whether the attribute with the given name exists.

Parameters

string $name

Return Value

bool

mixed getAttribute(string$name,mixed$default =null)

Returns the value of the given attribute.

Parameters

string $name
mixed $default

Return Value

mixed

mixed getData()

Returns the initial data of the form.

Return Value

mixed

string|null getDataClass()

Returns the class of the view data or null if the data is scalar or an array.

Return Value

string|null

bool getDataLocked()

Returns whether the form's data is locked.

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 Value

bool

FormFactoryInterface getFormFactory()

Returns the form factory used for creating new forms.

Return Value

FormFactoryInterface

string getAction()

Returns the target URL of the form.

Return Value

string

string getMethod()

Returns the HTTP method used by the form.

Return Value

string

RequestHandlerInterface getRequestHandler()

Returns the request handler used by the form.

bool getAutoInitialize()

Returns whether the form should be initialized upon creation.

Return Value

bool

array getOptions()

Returns all options passed during the construction of the form.

Return Value

array mixed> The passed options

bool hasOption(string$name)

Returns whether a specific option exists.

Parameters

string $name

Return Value

bool

mixed getOption(string$name,mixed$default =null)

Returns the value of a specific option.

Parameters

string $name
mixed $default

Return Value

mixed

callable|null getIsEmptyCallback()

Returns a callable that takes the model data as argument and that returns if it is empty or not.

Return Value

callable|null