ZF-2521: Add ALLOW_EMPTY functionality to Zend_Form_Element


Currently, non-required (i.e., optional) elements will fail validation when an empty value is provided for validation. In many cases, empty values are acceptable, and should not be passed to validators.

By default, this flag will be set to true; an accessor or config option will be used to disable it.


Resolved in r7709.

The new flag 'allowEmpty' (via the accessors setAllowEmpty() and getAllowEmpty()) now controls the behaviour of non-required elements. If the flag is true (the default value) and the element is not required, empty values do not get validated and the validations are assumed true.