|
Re: Problems with subForms: msg#00188php.zend.framework.mvc
-- Axel Wüstemann <awu-oRH8NxEK794@xxxxxxxxxxxxxxxx> wrote (on Thursday, 31 July 2008, 03:42 AM -0700): > For an event registration I need a registration form n-times, as n is the > count of sessions or subevents of a main event. <snip> > Then I create an empty form with Zend_Form and add the n SubForms to it: > > foreach($aSessions as $aSession) { > $oForm->addSubForm($oSubForm, 'session_'.$aSession['EVENT_ID']); > } > > What I get ist: all Subforms will have the same Id: You need to clone the sub form in each iteration; otherwise, the same object is used, so whichever sub form name is registered last wins. Try this instead: foreach($aSessions as $aSession) { $clone = clone $oSubForm; $oForm->addSubForm($clone, 'session_'.$aSession['EVENT_ID']); } -- Matthew Weier O'Phinney Software Architect | matthew-C1q0ot2/XZ0@xxxxxxxxxxxxxxxx Zend Framework | http://framework.zend.com/ |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Serializing Zend_Form elements with array notation: 00188, Matthew Weier O'Phinney |
|---|---|
| Next by Date: | Re: Zend_Form: Element grouping: 00188, Goran Jurić |
| Previous by Thread: | Problems with subFormsi: 00188, Axel Wüstemann |
| Next by Thread: | Re: Problems with subForms: 00188, Axel Wüstemann |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |