Do you have any idea why it is not recognizing the form name in my case? The form element ID attributes are rendered prefixed with "sell_", which is the form type's class name (SellFormType). But unfortunately the name attributes are not rendered like e. g. "sell[title]", as expected.
On Jun 30, 10:53 pm, Eric Clemmons <[email protected]> wrote: > If the name of your form is "foo", then the data will be stored nested > under the "foo" variable. (Query string will look like: > > foo[first_name]=this&foo[last_name]=that > > If you want to bind "first_name" instead of "lead[first_name]", then > just say "$form->bind($params)" instead of "$form->bindRequest(..."). > > On Jun 29, 3:46 pm, Kawa <[email protected]> wrote: > > > > > > > > > Hi, > > > Maybe someone can guide me to the right direction with this issue. > > > $form->bindRequest($this->get('request')); > > > is not working / not binding any data. The reason seems to be this > > line in Form::bindRequest() > > > $request->request->get($this->getName(), array()) > > > In my case, this will return an empty array, because the form data is > > not nested into a parameter with the form name as key. It is working > > when simply reading all request parameters: > > > $request->request->all() > > > My request parameters look like this after sending the form: > > > object(Symfony\Component\HttpFoundation\ParameterBag)#7 (1) > > { ["parameters":protected]=> array(4) { ["title"]=> string(7) > > "Test" ["subtitle"]=> string(4) "foo" ["lifetime"]=> string(1) > > "1" ["description"]=> string(4) "bar" } } > > > Any idea what's wrong with my form that the data is not stored nested, > > as expected by the code in bindRequest()? > > > Thanks -- 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 developers" 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-devs?hl=en
