zendframework/zf2 — pull request #3218 by mwillbanks (2012-12-13 18:45:44+00:00)
Title: Zend-Form: Allow Input Filter Preference Over Element Defaults

*Purpose:*
When building out forms you may want to give preference to the InputFilter set on the form while maintaining defaults that you have not overwritten.

*The Change*
A new property and 2 methods in Zend\Form\Form which set preferFormInputFilter variable
When checking for input filters; this property is utilized to simply continue if we find one otherwise it does what it did before.
The change is BC friendly.

*Simple Example*
1. Email element has defaults
2. Eliminate the validation portion
3. Utilize NotEmpty validator
4. Set a custom message.
5. Only NotEmpty validator is now set with custom error message (this wouldn't work previously)

```php
$form->setPreferFormInputFilter(true);
$form->setInputFilter($inputFilterFactory->createInputFilter(array(
'email' => array(
'name' => 'email',
'required' => true,
'validators' => array(
array(
'name' => 'NotEmpty',
'options' => array(
'messages' => array(
'notEmpty' => 'My new message for not empty',
),
),
),
),
),
));
```