Zend Framework
3.0
|
Public Member Functions | |
setOptions ($options) | |
Set options for a form. | |
add ($elementOrFieldset, array $flags=[]) | |
Add an element or fieldset. | |
prepare () | |
Ensures state is ready for use. | |
prepareElement (FormInterface $form) | |
Ensures state is ready for use. | |
setData ($data) | |
Set data to validate and/or populate elements. | |
bind ($object, $flags=FormInterface::VALUES_NORMALIZED) | |
Bind an object to the form. | |
setHydrator (HydratorInterface $hydrator) | |
Set the hydrator to use when binding an object to the element. | |
bindValues (array $values=[]) | |
Bind values to the bound object. | |
setBindOnValidate ($bindOnValidateFlag) | |
Set flag indicating whether or not to bind values on successful validation. | |
bindOnValidate () | |
Will we bind values to the bound object on successful validation? | |
setBaseFieldset (FieldsetInterface $baseFieldset) | |
Set the base fieldset to use when hydrating. | |
getBaseFieldset () | |
Get the base fieldset to use when hydrating. | |
hasValidated () | |
Check if the form has been validated. | |
isValid () | |
Validate the form. | |
getData ($flag=FormInterface::VALUES_NORMALIZED) | |
Retrieve the validated data. | |
setValidationGroup () | |
Set the validation group (set of values to validate) | |
getValidationGroup () | |
Retrieve the current validation group, if any. | |
setInputFilter (InputFilterInterface $inputFilter) | |
Set the input filter used by this form. | |
getInputFilter () | |
Retrieve input filter used by this form. | |
setUseInputFilterDefaults ($useInputFilterDefaults) | |
Set flag indicating whether or not to scan elements and fieldsets for defaults. | |
useInputFilterDefaults () | |
Should we use input filter defaults from elements and fieldsets? | |
setPreferFormInputFilter ($preferFormInputFilter) | |
Set flag indicating whether or not to prefer the form input filter over element and fieldset defaults. | |
getPreferFormInputFilter () | |
Should we use form input filter over element input filter defaults from elements and fieldsets? | |
attachInputFilterDefaults (InputFilterInterface $inputFilter, FieldsetInterface $fieldset) | |
Attach defaults provided by the elements to the input filter. | |
setWrapElements ($wrapElements) | |
Are the form elements/fieldsets names wrapped by the form name ? | |
wrapElements () | |
If true, form elements/fieldsets name's are wrapped around the form name itself. | |
populateValues ($data, $onlyBase=false) | |
| |
Public Member Functions inherited from Fieldset | |
__construct ($name=null, $options=[]) | |
setOptions ($options) | |
Set options for a fieldset. | |
setFormFactory (Factory $factory) | |
Compose a form factory to use when calling add() with a non-element/fieldset. | |
getFormFactory () | |
Retrieve composed form factory. | |
add ($elementOrFieldset, array $flags=[]) | |
Add an element or fieldset. | |
has ($elementOrFieldset) | |
Does the fieldset have an element/fieldset by the given name? | |
get ($elementOrFieldset) | |
Retrieve a named element or fieldset. | |
remove ($elementOrFieldset) | |
Remove a named element or fieldset. | |
setPriority ($elementOrFieldset, $priority) | |
Set/change the priority of an element or fieldset. | |
getElements () | |
Retrieve all attached elements. | |
getFieldsets () | |
Retrieve all attached fieldsets. | |
setMessages ($messages) | |
Set a hash of element names/messages to use when validation fails. | |
getMessages ($elementName=null) | |
Get validation error messages, if any. | |
prepareElement (FormInterface $form) | |
Ensures state is ready for use. | |
populateValues ($data) | |
Recursively populate values of attached elements and fieldsets. | |
count () | |
Countable: return count of attached elements/fieldsets. | |
getIterator () | |
IteratorAggregate: return internal iterator. | |
setObject ($object) | |
Set the object used by the hydrator. | |
getObject () | |
Get the object used by the hydrator. | |
setAllowedObjectBindingClass ($allowObjectBindingClass) | |
Set the class or interface of objects that can be bound to this fieldset. | |
allowedObjectBindingClass () | |
Get The class or interface of objects that can be bound to this fieldset. | |
allowObjectBinding ($object) | |
Checks if the object can be set in this fieldset. | |
setHydrator (HydratorInterface $hydrator) | |
Set the hydrator to use when binding an object to the element. | |
getHydrator () | |
Get the hydrator used when binding an object to the fieldset. | |
allowValueBinding () | |
Checks if this fieldset can bind data. | |
bindValues (array $values=[]) | |
Bind values to the bound object. | |
setUseAsBaseFieldset ($useAsBaseFieldset) | |
Set if this fieldset is used as a base fieldset. | |
useAsBaseFieldset () | |
Is this fieldset use as a base fieldset for a form ? | |
__clone () | |
Make a deep clone of a fieldset. | |
Public Member Functions inherited from Element | |
__construct ($name=null, $options=[]) | |
init () | |
This function is automatically called when creating element with factory. | |
setName ($name) | |
Set value for name. | |
getName () | |
Get value for name. | |
setOptions ($options) | |
Set options for an element. | |
getOptions () | |
Get defined options. | |
getOption ($option) | |
Return the specified option. | |
setOption ($key, $value) | |
Set a single option for an element. | |
setAttribute ($key, $value) | |
Set a single element attribute. | |
getAttribute ($key) | |
Retrieve a single element attribute. | |
removeAttribute ($key) | |
Remove a single attribute. | |
hasAttribute ($key) | |
Does the element has a specific attribute ? | |
setAttributes ($arrayOrTraversable) | |
Set many attributes at once. | |
getAttributes () | |
Retrieve all attributes at once. | |
removeAttributes (array $keys) | |
Remove many attributes at once. | |
clearAttributes () | |
Clear all attributes. | |
setValue ($value) | |
Set the element value. | |
getValue () | |
Retrieve the element value. | |
setLabel ($label) | |
Set the label used for this element. | |
getLabel () | |
Retrieve the label used for this element. | |
setLabelAttributes (array $labelAttributes) | |
Set the attributes to use with the label. | |
getLabelAttributes () | |
Get the attributes to use with the label. | |
setLabelOptions ($arrayOrTraversable) | |
Set many label options at once. | |
getLabelOptions () | |
Get label specific options. | |
clearLabelOptions () | |
Clear all label options. | |
removeLabelOptions (array $keys) | |
Remove many attributes at once. | |
setLabelOption ($key, $value) | |
Set a single label optionn. | |
getLabelOption ($key) | |
Retrieve a single label option. | |
removeLabelOption ($key) | |
Remove a single label option. | |
hasLabelOption ($key) | |
Does the element has a specific label option ? | |
setMessages ($messages) | |
Set a list of messages to report when validation fails. | |
getMessages () | |
Get validation error messages, if any. | |
Protected Member Functions | |
prepareBindData (array $values, array $match) | |
Parse filtered values and return only posted fields for binding. | |
prepareValidationGroup (FieldsetInterface $formOrFieldset, array $data, array &$validationGroup) | |
Prepare the validation group in case Collection elements were used (this function also handle the case where elements could have been dynamically added or removed from a collection using JavaScript) | |
extract () | |
Recursively extract values for elements and sub-fieldsets. | |
Protected Member Functions inherited from Fieldset | |
extract () | |
Extract values from the bound object. | |
Protected Attributes | |
$attributes | |
$bindAs = FormInterface::VALUES_NORMALIZED | |
$bindOnValidate = FormInterface::BIND_ON_VALIDATE | |
$baseFieldset | |
$data | |
$filter | |
$useInputFilterDefaults = true | |
$hasAddedInputFilterDefaults = false | |
$hasValidated = false | |
$isValid = false | |
$isPrepared = false | |
$preferFormInputFilter = true | |
$hasSetPreferFormInputFilter = false | |
$wrapElements = false | |
$validationGroup | |
Protected Attributes inherited from Fieldset | |
$factory | |
$elements = [] | |
$fieldsets = [] | |
$messages = [] | |
$iterator | |
$hydrator | |
$object | |
$useAsBaseFieldset = false | |
$allowedObjectBindingClass | |
Protected Attributes inherited from Element | |
$attributes = [] | |
$label | |
$labelAttributes = [] | |
$labelOptions = [] | |
$messages = [] | |
$options = [] | |
$value | |
Additional Inherited Members | |
Public Attributes inherited from FormInterface | |
const | BIND_ON_VALIDATE = 0x00 |
const | BIND_MANUAL = 0x01 |
const | VALIDATE_ALL = 0x10 |
const | VALUES_NORMALIZED = 0x11 |
const | VALUES_RAW = 0x12 |
const | VALUES_AS_ARRAY = 0x13 |
add | ( | $elementOrFieldset, | |
array | $flags = [] |
||
) |
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.
array | Traversable | ElementInterface | $elementOrFieldset | |
array | $flags |
Implements FieldsetInterface.
attachInputFilterDefaults | ( | InputFilterInterface | $inputFilter, |
FieldsetInterface | $fieldset | ||
) |
Attach defaults provided by the elements to the input filter.
InputFilterInterface | $inputFilter | |
FieldsetInterface | $fieldset | Fieldset to traverse when looking for default inputs |
bind | ( | $object, | |
$flags = FormInterface::VALUES_NORMALIZED |
|||
) |
Bind an object to the form.
Ensures the object is populated with validated values.
object | $object | |
int | $flags |
Exception\InvalidArgumentException |
Implements FormInterface.
bindOnValidate | ( | ) |
Will we bind values to the bound object on successful validation?
bindValues | ( | array | $values = [] | ) |
|
protected |
Recursively extract values for elements and sub-fieldsets.
getBaseFieldset | ( | ) |
Get the base fieldset to use when hydrating.
getData | ( | $flag = FormInterface::VALUES_NORMALIZED | ) |
Retrieve the validated data.
By default, retrieves normalized values; pass one of the FormInterface::VALUES_* constants to shape the behavior.
int | $flag |
Exception\DomainException |
Implements FormInterface.
getInputFilter | ( | ) |
getPreferFormInputFilter | ( | ) |
Should we use form input filter over element input filter defaults from elements and fieldsets?
getValidationGroup | ( | ) |
Retrieve the current validation group, if any.
hasValidated | ( | ) |
Check if the form has been validated.
isValid | ( | ) |
Validate the form.
Typically, will proxy to the composed input filter.
Exception\DomainException |
Implements FormInterface.
populateValues | ( | $data, | |
$onlyBase = false |
|||
) |
bool | $onlyBase |
prepare | ( | ) |
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.
|
protected |
Parse filtered values and return only posted fields for binding.
array | $values | |
array | $match |
prepareElement | ( | FormInterface | $form | ) |
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
FormInterface | $form |
Implements ElementPrepareAwareInterface.
|
protected |
Prepare the validation group in case Collection elements were used (this function also handle the case where elements could have been dynamically added or removed from a collection using JavaScript)
FieldsetInterface | $formOrFieldset | |
array | $data | |
array | $validationGroup |
setBaseFieldset | ( | FieldsetInterface | $baseFieldset | ) |
Set the base fieldset to use when hydrating.
FieldsetInterface | $baseFieldset |
Exception\InvalidArgumentException |
setBindOnValidate | ( | $bindOnValidateFlag | ) |
Set flag indicating whether or not to bind values on successful validation.
int | $bindOnValidateFlag |
Exception\InvalidArgumentException |
Implements FormInterface.
setData | ( | $data | ) |
Set data to validate and/or populate elements.
Typically, also passes data on to the composed input filter.
array | \ArrayAccess | Traversable | $data |
Exception\InvalidArgumentException |
Implements FormInterface.
setHydrator | ( | HydratorInterface | $hydrator | ) |
Set the hydrator to use when binding an object to the element.
HydratorInterface | $hydrator |
Implements FieldsetInterface.
setInputFilter | ( | InputFilterInterface | $inputFilter | ) |
Set the input filter used by this form.
InputFilterInterface | $inputFilter |
Implements FormInterface.
setOptions | ( | $options | ) |
Set options for a form.
Accepted options are:
array | Traversable | $options |
Exception\InvalidArgumentException |
Implements ElementInterface.
setPreferFormInputFilter | ( | $preferFormInputFilter | ) |
Set flag indicating whether or not to prefer the form input filter over element and fieldset defaults.
bool | $preferFormInputFilter |
setUseInputFilterDefaults | ( | $useInputFilterDefaults | ) |
Set flag indicating whether or not to scan elements and fieldsets for defaults.
bool | $useInputFilterDefaults |
setValidationGroup | ( | ) |
Set the validation group (set of values to validate)
Typically, proxies to the composed input filter
Exception\InvalidArgumentException |
Implements FormInterface.
setWrapElements | ( | $wrapElements | ) |
Are the form elements/fieldsets names wrapped by the form name ?
bool | $wrapElements |
useInputFilterDefaults | ( | ) |
Should we use input filter defaults from elements and fieldsets?
wrapElements | ( | ) |
If true, form elements/fieldsets name's are wrapped around the form name itself.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |