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?
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?
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',
),