FormConfigBuilderInterface (Component\Form)
Symfony\Component\Form\FormConfigBuilderInterface
interface FormConfigBuilderInterface implements FormConfigInterface
Methods
EventDispatcherInterface | getEventDispatcher() Returns the event dispatcher used to dispatch form events. | from FormConfigInterface |
string | getName() Returns the name of the form used as HTTP parameter. | from FormConfigInterface |
null|PropertyPathInterface | getPropertyPath() Returns the property path that the form should be mapped to. | from FormConfigInterface |
bool | getMapped() Returns whether the form should be mapped to an element of its parent's data. | from FormConfigInterface |
bool | getByReference() Returns whether the form's data should be modified by reference. | from FormConfigInterface |
bool | getInheritData() Returns whether the form should read and write the data of its parent. | from FormConfigInterface |
bool | getCompound() Returns whether the form is compound. | from FormConfigInterface |
ResolvedFormTypeInterface | getType() Returns the form types used to construct the form. | from FormConfigInterface |
DataTransformerInterface[] | getViewTransformers() Returns the view transformers of the form. | from FormConfigInterface |
DataTransformerInterface[] | getModelTransformers() Returns the model transformers of the form. | from FormConfigInterface |
DataMapperInterface | getDataMapper() Returns the data mapper of the form. | from FormConfigInterface |
bool | getRequired() Returns whether the form is required. | from FormConfigInterface |
bool | getDisabled() Returns whether the form is disabled. | from FormConfigInterface |
bool | getErrorBubbling() Returns whether errors attached to the form will bubble to its parent. | from FormConfigInterface |
mixed | getEmptyData() Returns the data that should be returned when the form is empty. | from FormConfigInterface |
array | getAttributes() Returns additional attributes of the form. | from FormConfigInterface |
bool | hasAttribute(string $name) Returns whether the attribute with the given name exists. | from FormConfigInterface |
mixed | getAttribute(string $name, mixed $default = null) Returns the value of the given attribute. | from FormConfigInterface |
mixed | getData() Returns the initial data of the form. | from FormConfigInterface |
string | getDataClass() Returns the class of the form data or null if the data is scalar or an array. | from FormConfigInterface |
bool | getDataLocked() Returns whether the form's data is locked. | from FormConfigInterface |
FormFactoryInterface | getFormFactory() Returns the form factory used for creating new forms. | from FormConfigInterface |
string | getAction() Returns the target URL of the form. | from FormConfigInterface |
string | getMethod() Returns the HTTP method used by the form. | from FormConfigInterface |
RequestHandlerInterface | getRequestHandler() Returns the request handler used by the form. | from FormConfigInterface |
bool | getAutoInitialize() Returns whether the form should be initialized upon creation. | from FormConfigInterface |
array | getOptions() Returns all options passed during the construction of the form. | from FormConfigInterface |
bool | hasOption(string $name) Returns whether a specific option exists. | from FormConfigInterface |
mixed | getOption(string $name, mixed $default = null) Returns the value of a specific option. | from FormConfigInterface |
FormConfigBuilderInterface | addEventListener(string $eventName, callable $listener, int $priority) Adds an event listener to an event on this form. | |
FormConfigBuilderInterface | addEventSubscriber(EventSubscriberInterface $subscriber) Adds an event subscriber for events on this form. | |
FormConfigBuilderInterface | addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false) Appends / prepends a transformer to the view transformer chain. | |
FormConfigBuilderInterface | resetViewTransformers() Clears the view transformers. | |
FormConfigBuilderInterface | addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false) Prepends / appends a transformer to the normalization transformer chain. | |
FormConfigBuilderInterface | resetModelTransformers() Clears the normalization transformers. | |
FormConfigBuilderInterface | setAttribute(string $name, mixed $value) Sets the value for an attribute. | |
FormConfigBuilderInterface | setAttributes(array $attributes) Sets the attributes. | |
FormConfigBuilderInterface | setDataMapper(DataMapperInterface $dataMapper = null) Sets the data mapper used by the form. | |
FormConfigBuilderInterface | setDisabled(bool $disabled) Set whether the form is disabled. | |
FormConfigBuilderInterface | setEmptyData(mixed $emptyData) Sets the data used for the client data when no value is submitted. | |
FormConfigBuilderInterface | setErrorBubbling(bool $errorBubbling) Sets whether errors bubble up to the parent. | |
FormConfigBuilderInterface | setRequired(bool $required) Sets whether this field is required to be filled out when submitted. | |
FormConfigBuilderInterface | setPropertyPath(null|string|PropertyPathInterface $propertyPath) Sets the property path that the form should be mapped to. | |
FormConfigBuilderInterface | setMapped(bool $mapped) Sets whether the form should be mapped to an element of its parent's data. | |
FormConfigBuilderInterface | setByReference(bool $byReference) Sets whether the form's data should be modified by reference. | |
FormConfigBuilderInterface | setInheritData(bool $inheritData) Sets whether the form should read and write the data of its parent. | |
FormConfigBuilderInterface | setCompound(bool $compound) Sets whether the form should be compound. | |
FormConfigBuilderInterface | setType(ResolvedFormTypeInterface $type) Set the types. | |
FormConfigBuilderInterface | setData(mixed $data) Sets the initial data of the form. | |
FormConfigBuilderInterface | setDataLocked(bool $locked) Locks the form's data to the data passed in the configuration. | |
setFormFactory(FormFactoryInterface $formFactory) Sets the form factory used for creating new forms. | ||
FormConfigBuilderInterface | setAction(string $action) Sets the target URL of the form. | |
FormConfigBuilderInterface | setMethod(string $method) Sets the HTTP method used by the form. | |
FormConfigBuilderInterface | setRequestHandler(RequestHandlerInterface $requestHandler) Sets the request handler used by the form. | |
FormConfigBuilderInterface | setAutoInitialize(bool $initialize) Sets whether the form should be initialized automatically. | |
FormConfigInterface | getFormConfig() Builds and returns the form configuration. |
Details
public EventDispatcherInterface getEventDispatcher()
Returns the event dispatcher used to dispatch form events.
public string getName()
Returns the name of the form used as HTTP parameter.
public null|PropertyPathInterface getPropertyPath()
Returns the property path that the form should be mapped to.
public bool getMapped()
Returns whether the form should be mapped to an element of its parent's data.
public bool getByReference()
Returns whether the form's data should be modified by reference.
public bool getInheritData()
Returns whether the form should read and write the data of its parent.
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.
public ResolvedFormTypeInterface getType()
Returns the form types used to construct the form.
public DataTransformerInterface[] getViewTransformers()
Returns the view transformers of the form.
public DataTransformerInterface[] getModelTransformers()
Returns the model transformers of the form.
public DataMapperInterface getDataMapper()
Returns the data mapper of the form.
public bool getRequired()
Returns whether the form is required.
public bool getDisabled()
Returns whether the form is disabled.
public bool getErrorBubbling()
Returns whether errors attached to the form will bubble to its parent.
public mixed getEmptyData()
Returns the data that should be returned when the form is empty.
public array getAttributes()
Returns additional attributes of the form.
public bool hasAttribute(string $name)
Returns whether the attribute with the given name exists.
public mixed getAttribute(string $name, mixed $default = null)
Returns the value of the given attribute.
public mixed getData()
Returns the initial data of the form.
public string getDataClass()
Returns the class of the form data or null if the data is scalar or an array.
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.
public FormFactoryInterface getFormFactory()
Returns the form factory used for creating new forms.
public string getAction()
Returns the target URL of the form.
public string getMethod()
Returns the HTTP method used by the form.
public RequestHandlerInterface getRequestHandler()
Returns the request handler used by the form.
public bool getAutoInitialize()
Returns whether the form should be initialized upon creation.
public array getOptions()
Returns all options passed during the construction of the form.
public bool hasOption(string $name)
Returns whether a specific option exists.
public mixed getOption(string $name, mixed $default = null)
Returns the value of a specific option.
public FormConfigBuilderInterface addEventListener(string $eventName, callable $listener, int $priority)
Adds an event listener to an event on this form.
public FormConfigBuilderInterface addEventSubscriber(EventSubscriberInterface $subscriber)
Adds an event subscriber for events on this form.
public FormConfigBuilderInterface addViewTransformer(DataTransformerInterface $viewTransformer, bool $forcePrepend = false)
Appends / prepends a transformer to the view transformer chain.
The transform method of the transformer is used to convert data from the normalized to the view format. The reverseTransform method of the transformer is used to convert from the view to the normalized format.
public FormConfigBuilderInterface resetViewTransformers()
Clears the view transformers.
public FormConfigBuilderInterface addModelTransformer(DataTransformerInterface $modelTransformer, bool $forceAppend = false)
Prepends / appends a transformer to the normalization transformer chain.
The transform method of the transformer is used to convert data from the model to the normalized format. The reverseTransform method of the transformer is used to convert from the normalized to the model format.
public FormConfigBuilderInterface resetModelTransformers()
Clears the normalization transformers.
public FormConfigBuilderInterface setAttribute(string $name, mixed $value)
Sets the value for an attribute.
public FormConfigBuilderInterface setAttributes(array $attributes)
Sets the attributes.
public FormConfigBuilderInterface setDataMapper(DataMapperInterface $dataMapper = null)
Sets the data mapper used by the form.
public FormConfigBuilderInterface setDisabled(bool $disabled)
Set whether the form is disabled.
public FormConfigBuilderInterface setEmptyData(mixed $emptyData)
Sets the data used for the client data when no value is submitted.
public FormConfigBuilderInterface setErrorBubbling(bool $errorBubbling)
Sets whether errors bubble up to the parent.
public FormConfigBuilderInterface setRequired(bool $required)
Sets whether this field is required to be filled out when submitted.
public FormConfigBuilderInterface setPropertyPath(null|string|PropertyPathInterface $propertyPath)
Sets the property path that the form should be mapped to.
public FormConfigBuilderInterface setMapped(bool $mapped)
Sets whether the form should be mapped to an element of its parent's data.
public FormConfigBuilderInterface setByReference(bool $byReference)
Sets whether the form's data should be modified by reference.
public FormConfigBuilderInterface setInheritData(bool $inheritData)
Sets whether the form should read and write the data of its parent.
public FormConfigBuilderInterface setCompound(bool $compound)
Sets whether the form should be compound.
public FormConfigBuilderInterface setType(ResolvedFormTypeInterface $type)
Set the types.
public FormConfigBuilderInterface setData(mixed $data)
Sets the initial data of the form.
public FormConfigBuilderInterface setDataLocked(bool $locked)
Locks the form's data to the data passed in the configuration.
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.
public setFormFactory(FormFactoryInterface $formFactory)
Sets the form factory used for creating new forms.
public FormConfigBuilderInterface setAction(string $action)
Sets the target URL of the form.
public FormConfigBuilderInterface setMethod(string $method)
Sets the HTTP method used by the form.
public FormConfigBuilderInterface setRequestHandler(RequestHandlerInterface $requestHandler)
Sets the request handler used by the form.
public FormConfigBuilderInterface setAutoInitialize(bool $initialize)
Sets whether the form should be initialized automatically.
Should be set to true only for root forms.
public FormConfigInterface getFormConfig()
Builds and returns the form configuration.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/Form/FormConfigBuilderInterface.html