Fully Qualified Name: | Zend\Form\Form |
Extends: | Fieldset |
Implements: | FormInterface |
Name | Description | Defined By |
---|---|---|
__clone() | Make a deep clone of a fieldset | Fieldset |
__construct() | Fieldset | |
add() | Add an element or fieldset | Form |
allowObjectBinding() | Checks if the object can be set in this fieldset | Fieldset |
allowValueBinding() | Checks if this fieldset can bind data | Fieldset |
allowedObjectBindingClass() | Get The class or interface of objects that can be bound to this fieldset. | Fieldset |
attachInputFilterDefaults() | Attach defaults provided by the elements to the input filter | Form |
bind() | Bind an object to the form | Form |
bindOnValidate() | Will we bind values to the bound object on successful validation? | Form |
bindValues() | Bind values to the bound object | Form |
clearAttributes() | Clear all attributes | Element |
clearLabelOptions() | Clear all label options | Element |
count() | Countable: return count of attached elements/fieldsets | Fieldset |
get() | Retrieve a named element or fieldset | Fieldset |
getAttribute() | Retrieve a single element attribute | Element |
getAttributes() | Retrieve all attributes at once | Element |
getBaseFieldset() | Get the base fieldset to use when hydrating | Form |
getData() | Retrieve the validated data | Form |
getElements() | Retrieve all attached elements | Fieldset |
getFieldsets() | Retrieve all attached fieldsets | Fieldset |
getFormFactory() | Retrieve composed form factory | Fieldset |
getHydrator() | Get the hydrator used when binding an object to the fieldset | Fieldset |
getInputFilter() | Retrieve input filter used by this form | Form |
getIterator() | IteratorAggregate: return internal iterator | Fieldset |
getLabel() | Retrieve the label used for this element | Element |
getLabelAttributes() | Get the attributes to use with the label | Element |
getLabelOption() | Retrieve a single label option | Element |
getLabelOptions() | Get label specific options | Element |
getMessages() | Get validation error messages, if any | Fieldset |
getName() | Get value for name | Element |
getObject() | Get the object used by the hydrator | Fieldset |
getOption() | Return the specified option | Element |
getOptions() | Get defined options | Element |
getPreferFormInputFilter() | Should we use form input filter over element input filter defaults from elements and fieldsets? | Form |
getValidationGroup() | Retrieve the current validation group, if any | Form |
getValue() | Retrieve the element value | Element |
has() | Does the fieldset have an element/fieldset by the given name? | Fieldset |
hasAttribute() | Does the element has a specific attribute ? | Element |
hasLabelOption() | Does the element has a specific label option ? | Element |
hasValidated() | Check if the form has been validated | Form |
init() | This function is automatically called when creating element with factory. It allows to perform various operations (add elements. | Element |
isValid() | Validate the form | Form |
populateValues() | {@inheritDoc} | Form |
prepare() | Ensures state is ready for use | Form |
prepareElement() | Ensures state is ready for use. Here, we append the name of the fieldsets to every elements in order to avoid name clashes if the same fieldset is used multiple times | Form |
remove() | Remove a named element or fieldset | Fieldset |
removeAttribute() | Remove a single attribute | Element |
removeAttributes() | Remove many attributes at once | Element |
removeLabelOption() | Remove a single label option | Element |
removeLabelOptions() | Remove many attributes at once | Element |
setAllowedObjectBindingClass() | Set the class or interface of objects that can be bound to this fieldset. | Fieldset |
setAttribute() | Set a single element attribute | Element |
setAttributes() | Set many attributes at once | Element |
setBaseFieldset() | Set the base fieldset to use when hydrating | Form |
setBindOnValidate() | Set flag indicating whether or not to bind values on successful validation | Form |
setData() | Set data to validate and/or populate elements | Form |
setFormFactory() | Compose a form factory to use when calling add() with a non-element/fieldset | Fieldset |
setHydrator() | Set the hydrator to use when binding an object to the element | Form |
setInputFilter() | Set the input filter used by this form | Form |
setLabel() | Set the label used for this element | Element |
setLabelAttributes() | Set the attributes to use with the label | Element |
setLabelOption() | Set a single label optionn | Element |
setLabelOptions() | Set many label options at once | Element |
setMessages() | Set a hash of element names/messages to use when validation fails | Fieldset |
setName() | Set value for name | Element |
setObject() | Set the object used by the hydrator | Fieldset |
setOption() | Set a single option for an element | Element |
setOptions() | Set options for a form. Accepted options are: - prefer_form_input_filter: is form input filter is preferred? | Form |
setPreferFormInputFilter() | Set flag indicating whether or not to prefer the form input filter over element and fieldset defaults | Form |
setPriority() | Set/change the priority of an element or fieldset | Fieldset |
setUseAsBaseFieldset() | Set if this fieldset is used as a base fieldset | Fieldset |
setUseInputFilterDefaults() | Set flag indicating whether or not to scan elements and fieldsets for defaults | Form |
setValidationGroup() | Set the validation group (set of values to validate) | Form |
setValue() | Set the element value | Element |
setWrapElements() | Are the form elements/fieldsets names wrapped by the form name ? | Form |
useAsBaseFieldset() | Is this fieldset use as a base fieldset for a form ? | Fieldset |
useInputFilterDefaults() | Should we use input filter defaults from elements and fieldsets? | Form |
wrapElements() | If true, form elements/fieldsets name's are wrapped around the form name itself | Form |
Make a deep clone of a fieldset
Returns: void
Parameter Name | Type | Description |
---|---|---|
$name | null|int|string | Optional |
$options | array | Optional |
Returns:
Add an element or fieldset
If $elementOrFieldset is an array or Traversable, passes the argument on to the composed factory to create the object before attaching it.
$flags could contain metadata such as the alias under which to register the element or fieldset, order in which to prioritize it, etc.
Parameter Name | Type | Description |
---|---|---|
$elementOrFieldset | array|\Traversable|\ElementInterface | |
$flags | array |
Returns: self
Checks if the object can be set in this fieldset
Parameter Name | Type | Description |
---|---|---|
$object | object |
Returns: bool
Checks if this fieldset can bind data
Returns: bool
Get The class or interface of objects that can be bound to this fieldset.
Returns: string
Attach defaults provided by the elements to the input filter
Parameter Name | Type | Description |
---|---|---|
$inputFilter | \InputFilterInterface | |
$fieldset | \FieldsetInterface | Fieldset |
Returns: void
Bind an object to the form
Ensures the object is populated with validated values.
Parameter Name | Type | Description |
---|---|---|
$object | object | |
$flags | int |
Returns: self
Will we bind values to the bound object on successful validation?
Returns: bool
Bind values to the bound object
Parameter Name | Type | Description |
---|---|---|
$values | array | |
$validationGroup |
Returns: mixed
Clear all attributes
Returns: \Element|\ElementInterface
Clear all label options
Returns: \Element|\ElementInterface
Countable: return count of attached elements/fieldsets
Returns: int
Retrieve a named element or fieldset
Parameter Name | Type | Description |
---|---|---|
$elementOrFieldset | string |
Returns: \ElementInterface|\FieldsetInterface
Retrieve a single element attribute
Parameter Name | Type | Description |
---|---|---|
$key | ||
$key |
Returns: mixed|null
Retrieve all attributes at once
Returns: array|\Traversable
Get the base fieldset to use when hydrating
Returns: \FieldsetInterface
Retrieve the validated data
By default, retrieves normalized values; pass one of the FormInterface::VALUES_* constants to shape the behavior.
Parameter Name | Type | Description |
---|---|---|
$flag | int |
Returns: array|object
Retrieve all attached elements
Storage is an implementation detail of the concrete class.
Returns: array|\Traversable
Retrieve all attached fieldsets
Storage is an implementation detail of the concrete class.
Returns: array|\Traversable
Retrieve composed form factory
Lazy-loads one if none present.
Returns: \Factory
Get the hydrator used when binding an object to the fieldset
If no hydrator is present and object implements HydratorAwareInterface, hydrator will be retrieved from the object.
Will lazy-load Hydrator\ArraySerializable if none is present.
Returns: \HydratorInterface
Retrieve input filter used by this form
Returns: null|\InputFilterInterface
IteratorAggregate: return internal iterator
Returns: \PriorityList
Retrieve the label used for this element
Returns: null|string
Get the attributes to use with the label
Returns: array
Retrieve a single label option
Parameter Name | Type | Description |
---|---|---|
$key | ||
$key |
Returns: mixed|null
Get label specific options
Returns: array
Get validation error messages, if any
Returns a hash of element names/messages for all elements failing validation, or, if $elementName is provided, messages for that element only.
Parameter Name | Type | Description |
---|---|---|
$elementName | null|string |
Returns: array|\Traversable
Get value for name
Returns: string|int
Get the object used by the hydrator
Returns: mixed
Return the specified option
Parameter Name | Type | Description |
---|---|---|
$option | string |
Returns: null|mixed
Get defined options
Returns: array
Should we use form input filter over element input filter defaults from elements and fieldsets?
Returns: bool
Retrieve the current validation group, if any
Returns: null|array
Retrieve the element value
Returns: mixed
Does the fieldset have an element/fieldset by the given name?
Parameter Name | Type | Description |
---|---|---|
$elementOrFieldset | string |
Returns: bool
Does the element has a specific attribute ?
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: bool
Does the element has a specific label option ?
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: bool
Check if the form has been validated
Returns: bool
This function is automatically called when creating element with factory. It allows to perform various operations (add elements.
..)
Returns: void
Validate the form
Typically, will proxy to the composed input filter.
Returns: bool
{@inheritDoc}
Parameter Name | Type | Description |
---|---|---|
$onlyBase | bool | |
$data |
Returns:
Ensures state is ready for use
Marshalls the input filter, to ensure validation error messages are available, and prepares any elements and/or fieldsets that require preparation.
Returns: self
Ensures state is ready for use. Here, we append the name of the fieldsets to every elements in order to avoid name clashes if the same fieldset is used multiple times
Parameter Name | Type | Description |
---|---|---|
$form | \FormInterface |
Returns: mixed|void
Remove a named element or fieldset
Parameter Name | Type | Description |
---|---|---|
$elementOrFieldset | string |
Returns: \FieldsetInterface
Remove a single attribute
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: \ElementInterface
Remove many attributes at once
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: \ElementInterface
Remove a single label option
Parameter Name | Type | Description |
---|---|---|
$key | string |
Returns: \ElementInterface
Remove many attributes at once
Parameter Name | Type | Description |
---|---|---|
$keys | array |
Returns: \ElementInterface
Set the class or interface of objects that can be bound to this fieldset.
Parameter Name | Type | Description |
---|---|---|
$allowObjectBindingClass | string |
Returns:
Set a single element attribute
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: \Element|\ElementInterface
Set many attributes at once
Implementation will decide if this will overwrite or merge.
Parameter Name | Type | Description |
---|---|---|
$arrayOrTraversable | array|\Traversable |
Returns: \Element|\ElementInterface
Set the base fieldset to use when hydrating
Parameter Name | Type | Description |
---|---|---|
$baseFieldset | \FieldsetInterface |
Returns: self
Set flag indicating whether or not to bind values on successful validation
Parameter Name | Type | Description |
---|---|---|
$bindOnValidateFlag | int |
Returns: self
Set data to validate and/or populate elements
Typically, also passes data on to the composed input filter.
Parameter Name | Type | Description |
---|---|---|
$data | array|\ArrayAccess|\Traversable |
Returns: self
Compose a form factory to use when calling add() with a non-element/fieldset
Parameter Name | Type | Description |
---|---|---|
$factory | \Factory |
Returns: \Form
Set the hydrator to use when binding an object to the element
Parameter Name | Type | Description |
---|---|---|
$hydrator | \HydratorInterface |
Returns: \FieldsetInterface
Set the input filter used by this form
Parameter Name | Type | Description |
---|---|---|
$inputFilter | \InputFilterInterface |
Returns: self
Set the label used for this element
Parameter Name | Type | Description |
---|---|---|
$label | ||
$label |
Returns: \Element|\ElementInterface
Set the attributes to use with the label
Parameter Name | Type | Description |
---|---|---|
$labelAttributes | array |
Returns: \Element|\ElementInterface
Set a single label optionn
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: \Element|\ElementInterface
Set many label options at once
Implementation will decide if this will overwrite or merge.
Parameter Name | Type | Description |
---|---|---|
$arrayOrTraversable | array|\Traversable |
Returns: \Element|\ElementInterface
Set a hash of element names/messages to use when validation fails
Parameter Name | Type | Description |
---|---|---|
$messages | array|\Traversable |
Returns: \Element|\ElementInterface|\FieldsetInterface
Set value for name
Parameter Name | Type | Description |
---|---|---|
$name | string |
Returns: \Element|\ElementInterface
Set the object used by the hydrator
Parameter Name | Type | Description |
---|---|---|
$object | object |
Returns: \Fieldset|\FieldsetInterface
Set a single option for an element
Parameter Name | Type | Description |
---|---|---|
$key | string | |
$value | mixed |
Returns: self
Set options for a form. Accepted options are: - prefer_form_input_filter: is form input filter is preferred?
Parameter Name | Type | Description |
---|---|---|
$options | array|\Traversable |
Returns: self
Set flag indicating whether or not to prefer the form input filter over element and fieldset defaults
Parameter Name | Type | Description |
---|---|---|
$preferFormInputFilter | bool |
Returns: self
Set/change the priority of an element or fieldset
Parameter Name | Type | Description |
---|---|---|
$elementOrFieldset | string | |
$priority | int |
Returns: \FieldsetInterface
Set if this fieldset is used as a base fieldset
Parameter Name | Type | Description |
---|---|---|
$useAsBaseFieldset | bool |
Returns: \Fieldset
Set flag indicating whether or not to scan elements and fieldsets for defaults
Parameter Name | Type | Description |
---|---|---|
$useInputFilterDefaults | bool |
Returns: self
Set the validation group (set of values to validate)
Typically, proxies to the composed input filter
Returns: self
Set the element value
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: \Element
Are the form elements/fieldsets names wrapped by the form name ?
Parameter Name | Type | Description |
---|---|---|
$wrapElements | bool |
Returns: self
Is this fieldset use as a base fieldset for a form ?
Returns: bool
Should we use input filter defaults from elements and fieldsets?
Returns: bool
If true, form elements/fieldsets name's are wrapped around the form name itself
Returns: bool