B
B
bahek24627742014-08-01 09:10:34
Zend Framework
bahek2462774, 2014-08-01 09:10:34

ZF2 - How to validate Zend\Form\Element\Collection?

I have this element in my form.

$this->add(array(
            'type' => 'Zend\Form\Element\Collection',
            'name' => 'orders_tourists',
            'options' => array(
                'should_create_template' => true,
                'allow_add' => true,
                'target_element' => array(
                    'type' => 'Zend\Form\Element\Text',
                )
            )
        ));

I have to catch ordes_tourists[0] = "blababa", ordes_tourists[1] = "blababa", ordes_tourists[2] = "blababa" - which arrive by ajax.
How do I validate (validate this element) - how can I make it easier?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question