zendframework/zf2-documentation — pull request #239 by uncle-fred (2012-09-09 16:32:21+00:00)
Title: Input factory expects the "type" to be a class

Changed 'Zend\Filter\InputFilter' to 'Zend\InputFilter\InputFilter'

However:
looks like the second filter can not see the data set by 'setData'

Example:
use Zend\InputFilter\InputFilter;

$filter = new InputFilter();

// Adding a single input
$filter->add(array(
'name' => 'username',
'required' => true,
'validators' => array(
array(
'name' => 'not_empty',
),
array(
'name' => 'string_length',
'options' => array(
'min' => 5
),
),
),
));

// Adding another input filter what also contains a single input. Merging both.
$filter->add(array(
'type' => 'Zend\InputFilter\InputFilter',
'password' => array(
'name' => 'password',
'required' => true,
'validators' => array(
array(
'name' => 'not_empty',
),
array(
'name' => 'string_length',
'options' => array(
'min' => 8
),
),
),
),
));

$filter->setData(array('username' => 'foobar', 'password' => 'bar'));

if (!$filter->isValid()) {
foreach ($filter->getInvalidInput() as $error) {
echo 'Invalid:'; print_r($error->getMessages());
}
}