Hi,

I currently have a form. This form has a fieldset "data" with the three
elements "name", "price" and "category". The form also has a submit
element called "save". When I want to set the data I need to pass such
an array.

$form->setData(array(
    'data' => array(
        'name'     => 'Pizza 123          ',
        'price'    => '€  6.95',
        'category' => '1a',
    ),
));

Works as expected.

Now I have an InputFilter for the three elements "name", "price" and
"category". I attach it to the form. After validation no errors are
shown and no data is filtered. The InputFilter is ignored.

I quite understand it since the form elements "name", "price" and
"category" are no elements of the form, they are elements of the
fieldset. So I rather need to attach the InputFilter to the fieldset.
Unfortunately, this is not possible.

When it comes to the form collections I found the usage of the
InputFilterProviderInterface which expects an
getInputFilterSpecification() method to be implemented. This method
should pass an array.

http://zf2.readthedocs.org/en/latest/modules/zend.form.collections.html

But for this szenario I cannot use my InputFilter class. Or is there a
way how to do it?

If not it does not seem to be possible to use an InputFilter object with
a form that useses fieldsets/collections. I do need to use the
InputFilterProviderInterface instead. Is this correct?

Regards,

Ralf

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to