Quantcast

[ZF1] Zend_Form and array notation - kinda stuck

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

[ZF1] Zend_Form and array notation - kinda stuck

Jamie Krasnoo
Hey all,

I'm trying to get this type of array notation for a custom Zend_Form.

fields[0][name]
fields[0][description]
fields[0][required]
...


The form will be dynamic and at the same time the class will have to be
able to process the POST input. I've been somewhat successful but the array
notation is giving me a problem. I figure I can do it one of two ways. I
can make a custom element and go a ViewScript to render it or I can use sub
forms, or both. I'm wondering if anyone has done this have been able to
group them together like I'd like above or did they have to hack in to the
code somewhat to get it to do what they want. Could someone give me a nudge
in the right direction?

Jamie
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: [ZF1] Zend_Form and array notation - kinda stuck

Andreas Möller
> fields[0][name]
> fields[0][description]
> fields[0][required]

I've observed circumstances where this was achieved using subforms.

There, the purpose was to synchronise the submitted post data with
Doctrine records.

I felt it was overkill, but it serves its purpose.


Best regards,

Andreas

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


Loading...