Why is this complicated? As long as the FormType has a getName() method that returns "register", the Form will properly bind to the data when you call bindRequest().
On Thu, May 5, 2011 at 9:03 AM, Michael Holm <ho...@hollo.dk> wrote: > Hi, > > Im building a REST API for my application, and what i want to do is > use the form component to validate the input from the users.. > > But the problem is: > > If i have a form class, really basic example: > > public function buildForm(FormBuilder $builder, array $options)) > { > $buider->add('email_address'); > } > > public function getDefaultOptions(array $options) > { > return array( > 'data_class' => 'Pub\UserBundle\Entity\User' > ); > } > > all this is almost just fine, then problem come when i get my data.. > the form expect the form to look like: > > <input type="text" name="register[email_address]" /> > > that will just make the api a whole lot more complicated, are there > any way to make the form expect a html tag like this: > > <input type="text" name="email_address" /> > > Hope that someone can help me.. > > Best regards, > Michael Holm > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en