Symfony2 API
Interface

Symfony\Component\Form\FormConfigInterface

interface FormConfigInterface

The configuration of a {@link Form} object.

Methods

EventDispatcherInterface getEventDispatcher()

Returns the event dispatcher used to dispatch form events.

string getName()

Returns the name of the form used as HTTP parameter.

null|PropertyPathInterface 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.

ResolvedFormTypeInterface getType()

Returns the form types used to construct the form.

DataTransformerInterface[] getViewTransformers()

Returns the view transformers of the form.

DataTransformerInterface[] getModelTransformers()

Returns the model transformers of the form.

DataMapperInterface getDataMapper()

Returns the data mapper of the 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()

Returns the data that should be returned when the form is empty.

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 getDataClass()

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

bool getDataLocked()

Returns whether the form's data is locked.

FormFactoryInterface 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.

RequestHandlerInterface 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.

Details

at line 29
public EventDispatcherInterface getEventDispatcher()

Returns the event dispatcher used to dispatch form events.

Return Value

EventDispatcherInterface The dispatcher.

at line 36
public string getName()

Returns the name of the form used as HTTP parameter.

Return Value

string The form name.

at line 43
public null|PropertyPathInterface getPropertyPath()

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

Return Value

null|PropertyPathInterface The property path.

at line 51
public bool getMapped()

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

Return Value

bool Whether the form is mapped.

at line 58
public bool getByReference()

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

Return Value

bool Whether to modify the form's data by reference.

at line 65
public bool getInheritData()

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

Return Value

bool Whether the form should inherit its parent's data.

at line 76
public 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.

Return Value

bool Whether the form is compound.

at line 83
public ResolvedFormTypeInterface getType()

Returns the form types used to construct the form.

Return Value

ResolvedFormTypeInterface The form's type.

at line 90
public DataTransformerInterface[] getViewTransformers()

Returns the view transformers of the form.

Return Value

DataTransformerInterface[] An array of {@link DataTransformerInterface} instances.

at line 97
public DataTransformerInterface[] getModelTransformers()

Returns the model transformers of the form.

Return Value

DataTransformerInterface[] An array of {@link DataTransformerInterface} instances.

at line 104
public DataMapperInterface getDataMapper()

Returns the data mapper of the form.

Return Value

DataMapperInterface The data mapper.

at line 111
public bool getRequired()

Returns whether the form is required.

Return Value

bool Whether the form is required.

at line 118
public bool getDisabled()

Returns whether the form is disabled.

Return Value

bool Whether the form is disabled.

at line 125
public bool getErrorBubbling()

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

Return Value

bool Whether errors will bubble up.

at line 132
public mixed getEmptyData()

Returns the data that should be returned when the form is empty.

Return Value

mixed The data returned if the form is empty.

at line 139
public array getAttributes()

Returns additional attributes of the form.

Return Value

array An array of key-value combinations.

at line 148
public bool hasAttribute(string $name)

Returns whether the attribute with the given name exists.

Parameters

string $name The attribute name.

Return Value

bool Whether the attribute exists.

at line 158
public mixed getAttribute(string $name, mixed $default = null)

Returns the value of the given attribute.

Parameters

string $name The attribute name.
mixed $default The value returned if the attribute does not exist.

Return Value

mixed The attribute value.

at line 165
public mixed getData()

Returns the initial data of the form.

Return Value

mixed The initial form data.

at line 172
public string getDataClass()

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

Return Value

string The data class or null.

at line 183
public 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 Whether the data is locked.

at line 190
public FormFactoryInterface getFormFactory()

Returns the form factory used for creating new forms.

Return Value

FormFactoryInterface The form factory.

at line 197
public string getAction()

Returns the target URL of the form.

Return Value

string The target URL of the form.

at line 204
public string getMethod()

Returns the HTTP method used by the form.

Return Value

string The HTTP method of the form.

at line 211
public RequestHandlerInterface getRequestHandler()

Returns the request handler used by the form.

Return Value

RequestHandlerInterface The request handler.

at line 219
public bool getAutoInitialize()

Returns whether the form should be initialized upon creation.

Return Value

bool Returns true if the form should be initialized when created, false otherwise.

at line 226
public array getOptions()

Returns all options passed during the construction of the form.

Return Value

array The passed options.

at line 235
public bool hasOption(string $name)

Returns whether a specific option exists.

Parameters

string $name The option name,

Return Value

bool Whether the option exists.

at line 245
public mixed getOption(string $name, mixed $default = null)

Returns the value of a specific option.

Parameters

string $name The option name.
mixed $default The value returned if the option does not exist.

Return Value

mixed The option value.