Skip to content

Instantly share code, notes, and snippets.

@ezimuel
Created May 22, 2012 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ezimuel/2769399 to your computer and use it in GitHub Desktop.
Save ezimuel/2769399 to your computer and use it in GitHub Desktop.
Zend\InputFilter issue
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