0

In my application I would like to use serval inputs in the way of name="inputname[] .

This because I have a form to add more than one child names on a parent. I am wondering how ZF2 works with this procedure?

Amit Verma
  • 40,709
  • 21
  • 93
  • 115
directory
  • 3,093
  • 8
  • 45
  • 85
  • You you specify exactly what you mean by "I am wondering how ZF2 works with this procedure?". I suspect you have a more specific question in mind than the one you are asking. – Rick Smith Jun 17 '15 at 16:10
  • Look at http://zf2.readthedocs.org/en/latest/modules/zend.form.collections.html – venca Jun 18 '15 at 06:52

1 Answers1

0

I guess you are talking about form collections. There is a lot of documentation available on collections.

http://framework.zend.com/manual/current/en/modules/zend.form.collections.html

or link proposed by @venca

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

If you are more specific in your question then the answer can also be more specific.

For validating collections inside a parent I can refer to my answer on another question here.

It is as simple as:

'children' => array(
    'required' => true,
    'count' => ... optional count ...
    'input_filter' => ... input filter or input filter config to use for each element ...
    'type' => 'Zend\InputFilter\CollectionInputFilter',
),
Community
  • 1
  • 1
Wilt
  • 41,477
  • 12
  • 152
  • 203