zendframework/zf2 — pull request #2203 by cgmartin (2012-08-20 00:25:53+00:00)
Title: [Fix] Allow adding a custom NotEmpty validator to a required Input

Was trying to add custom validator messages to a NotEmpty validator on a required Input, but couldn't...

This fix allows adding a custom NotEmpty validator to an Input. If the Input is required, it will first look through the existing validators and skip adding a default NotEmpty if one is found.

Example usage:
```php
$myTextInput = new Input('mytext');
$chain = $myTextInput->getValidatorChain();
$chain->prependByName('NotEmpty', array('messages' => array('isEmpty' => 'CANT BE EMPTY')));
$myTextInput->setRequired(true);
```