Created
May 22, 2012 14:27
-
-
Save ezimuel/2769399 to your computer and use it in GitHub Desktop.
Zend\InputFilter issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use Zend\InputFilter\InputFilter, | |
Zend\InputFilter\Input; | |
$input = new Input('foo'); | |
$input->getFilterChain() | |
->attachByName('stringtrim') | |
->attachByName('alpha'); | |
$inputFilter = new InputFilter(); | |
$inputFilter->add($input) | |
->setData(array( | |
'foo' => ' Bar3 ' | |
)); | |
// if I remove the isValid() the getValue() or getRawValue() return EMPTY values | |
// $inputFilter->isValid(); | |
echo "Before:\n"; | |
echo $inputFilter->getRawValue('foo') . "\n"; | |
echo "After:\n"; | |
echo $inputFilter->getValue('foo') . "\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment