you can do this in the main form to call the embedForm bind() method: foreach($this->embeddedForms as $name => $form) $form->bind($taintedValues[$name]);
On 2 juil, 15:38, Tom Haskins-Vaughan <[email protected]> wrote: > Hi. > > I have a question about embedding and binding forms. > > Firstly, my model is basically: > > Product has many Criteria has many Options. > > So, following the tutorial at sandbox-ws.com [1] on embedding forms in > sf 1.2, I do the following: > > 1. Create Product form > > 2. Embed Product->Criteria forms into Product form > > 3. Add new Criterion form and embed it into Product form > > Now, having done this, I need to override the bind() method of the > Product form to account for whether or not the new Criterion form was used. > > Ok, so far. > > Now, for each Product->Criteria form, I embed Product->Criteria->Options > forms including a blank one. > > Now according to this thread [2] only the bind() method of the main form > is called. So instead of being able to update the bind() method of the > Criterion form, I have to, in my opinion, put it all in the main form > bind() method. > > I guess my question is, what was the reasoning behind this, and wouldn't > it be better to be able to keep all the relevant information for each > form in it's associated bind() method? > > Thanks, > > Tom > > [1]http://sandbox-ws.com/how-to-embed-forms-in-symfony-12-admin-generato... > > [2]http://groups.google.com/group/symfony-devs/browse_thread/thread/dc2c... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
