zendframework/zf2 — pull request #1693 by bakura10 (2012-06-30 20:11:12+00:00)
Title: Collection for form

This is a work in progress, please don't merge right now, I need some feedbacks (and I didn't write the test for the moment).

This PR allows to deal with the following problem : in my project and many other, I need to add form elements (either fieldset or simple element) dynamically using JavaScript, and still being able to validate them correctly and get them. It also allows to create "template" elements or field sets so that the creation can be very easy using JavaScript.

I tried to solve this solution here. At some places it may little "hacky" so that's why I need some advice, and if you would like to see some other features.

I have created a file where you could have some use-cases (well... after writing it it looks more like a doc, sorry) : https://gist.github.com/3025309

This PR also moves the factory from Form to Fieldset.