Form

extends Zend\Form\Fieldset implements Countable , IteratorAggregate , Traversable , Zend\Form\ElementInterface , Zend\Form\ElementPrepareAwareInterface , Zend\Form\FieldsetInterface , Zend\Form\FormFactoryAwareInterface , Zend\Form\FormInterface

Known subclasses

Omeka\Form\ActivateForm, Omeka\Form\ConfirmForm, Omeka\Form\ForgotPasswordForm, Omeka\Form\InstallationForm, Omeka\Form\LoginForm, Omeka\Form\ModuleStateChangeForm, Omeka\Form\ResourceBatchUpdateForm, Omeka\Form\ResourceForm, Omeka\Form\ResourceTemplateForm, Omeka\Form\ResourceTemplateImportForm, Omeka\Form\ResourceTemplateReviewImportForm, Omeka\Form\SettingForm, Omeka\Form\SiteForm, Omeka\Form\SitePageForm, Omeka\Form\SiteSettingsForm, Omeka\Form\UserForm, Omeka\Form\VocabularyForm, Omeka\Form\VocabularyImportForm, Omeka\Form\VocabularyUpdateForm
Methods Summary
public
# setOptions( array|\Traversable $options )
Set options for a form. Accepted options are: - prefer_form_input_filter: is form input filter is preferred?

Overrides

Implementation of

public
# add( array|\Traversable|\ElementInterface $elementOrFieldset , array $flags = array ( ) )
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.

Overrides

Implementation of

public
# 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.
public
# prepareElement( Zend\Form\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

Overrides

Implementation of

public
# setData( array|\ArrayAccess|\Traversable $data )
Set data to validate and/or populate elements Typically, also passes data on to the composed input filter.

Implementation of

public
# bind( object $object , int $flags = 17 )
Bind an object to the form Ensures the object is populated with validated values.

Implementation of

public
# setHydrator( Zend\Hydrator\HydratorInterface $hydrator )
Set the hydrator to use when binding an object to the element

Overrides

Implementation of

public
# bindValues( array $values = array ( ) )
Bind values to the bound object

Overrides

Implementation of

protected
# prepareBindData( array $values , array $match )
Parse filtered values and return only posted fields for binding
public
# setBindOnValidate( int $bindOnValidateFlag )
Set flag indicating whether or not to bind values on successful validation

Implementation of

public
# bindOnValidate( )
Will we bind values to the bound object on successful validation?
public
# setBaseFieldset( Zend\Form\FieldsetInterface $baseFieldset )
Set the base fieldset to use when hydrating
public
# getBaseFieldset( )
Get the base fieldset to use when hydrating
public
# hasValidated( )
Check if the form has been validated
public
# isValid( )
Validate the form Typically, will proxy to the composed input filter.

Implementation of

public
# getData( int $flag = 17 )
Retrieve the validated data By default, retrieves normalized values; pass one of the FormInterface::VALUES_* constants to shape the behavior.

Implementation of

public
# setValidationGroup( )
Set the validation group (set of values to validate) Typically, proxies to the composed input filter

Implementation of

public
# getValidationGroup( )
Retrieve the current validation group, if any
protected
# prepareValidationGroup( Zend\Form\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)
public
# setInputFilter( Zend\InputFilter\InputFilterInterface $inputFilter )
Set the input filter used by this form

Implementation of

public
# getInputFilter( )
Retrieve input filter used by this form

Implementation of

public
# setUseInputFilterDefaults( bool $useInputFilterDefaults )
Set flag indicating whether or not to scan elements and fieldsets for defaults
public
# useInputFilterDefaults( )
Should we use input filter defaults from elements and fieldsets?
public
# setPreferFormInputFilter( bool $preferFormInputFilter )
Set flag indicating whether or not to prefer the form input filter over element and fieldset defaults
public
# getPreferFormInputFilter( )
Should we use form input filter over element input filter defaults from elements and fieldsets?
public
# attachInputFilterDefaults( Zend\InputFilter\InputFilterInterface $inputFilter , Zend\Form\FieldsetInterface $fieldset )
Attach defaults provided by the elements to the input filter
public
# setWrapElements( bool $wrapElements )
Are the form elements/fieldsets names wrapped by the form name ?
public
# wrapElements( )
If true, form elements/fieldsets name's are wrapped around the form name itself
public
# populateValues( bool $data , $onlyBase = false )
protected
# extract( )
Recursively extract values for elements and sub-fieldsets

Overrides

Methods inherited from Zend\Form\Fieldset
__construct(), setOptions(), setFormFactory(), getFormFactory(), add(), has(), get(), remove(), setPriority(), getElements(), getFieldsets(), setMessages(), getMessages(), prepareElement(), populateValues(), count(), getIterator(), setObject(), getObject(), setAllowedObjectBindingClass(), allowedObjectBindingClass(), allowObjectBinding(), setHydrator(), getHydrator(), allowValueBinding(), bindValues(), setUseAsBaseFieldset(), useAsBaseFieldset(), extract(), __clone()
Methods inherited from Zend\Form\Element
__construct(), init(), setName(), getName(), setOptions(), getOptions(), getOption(), setOption(), setAttribute(), getAttribute(), removeAttribute(), hasAttribute(), setAttributes(), getAttributes(), removeAttributes(), clearAttributes(), setValue(), getValue(), setLabel(), getLabel(), setLabelAttributes(), getLabelAttributes(), setLabelOptions(), getLabelOptions(), clearLabelOptions(), removeLabelOptions(), setLabelOption(), getLabelOption(), removeLabelOption(), hasLabelOption(), setMessages(), getMessages()
Properties Summary
protected array $attributes
Seed attributes
# array ( 'method' => 'POST', )
protected int $bindAs
How to bind values to the attached object
# 17
protected int $bindOnValidate
Whether or not to bind values to the bound object on successful validation
# 0
protected Zend\Form\FieldsetInterface $baseFieldset
Base fieldset to use for hydrating (if none specified, directly hydrate elements)
# NULL
protected null|array|\Traversable $data
Data being validated
# NULL
protected null|\Zend\InputFilter\InputFilterInterface $filter
# NULL
protected bool $useInputFilterDefaults
Whether or not to automatically scan for input filter defaults on attached fieldsets and elements
# true
protected bool $hasAddedInputFilterDefaults
Has the input filter defaults been added already ?
# false
protected bool $hasValidated
Whether or not validation has occurred
# false
protected bool $isValid
Result of last validation operation
# false
protected bool $isPrepared
Is the form prepared ?
# false
protected bool $preferFormInputFilter
Prefer form input filter over input filter defaults
# true
protected bool $hasSetPreferFormInputFilter
Has preferFormInputFilter been set with setPreferFormInputFilter?
# false
protected bool $wrapElements
Are the form elements/fieldsets wrapped by the form name ?
# false
protected null|array $validationGroup
Validation group, if any
# NULL
Properties inherited from Zend\Form\Fieldset
$factory, $elements, $fieldsets, $messages, $iterator, $hydrator, $object, $useAsBaseFieldset, $allowedObjectBindingClass
Properties inherited from Zend\Form\Element
$attributes, $label, $labelAttributes, $labelOptions, $messages, $options, $value