I've the basic form, template and controller action of Symfony2 documentation for this example.
Whenever I try to get a parameter of the form in controller action I have to use this:
$parameters = $request->request->all();
$name = $parameters["form"]["name"];
However, in documentation use this:
$name = $request->request->get('name');
But this is wrong for me, in this case $name is null and the Object request(ParameterBag) contain this:
object(Symfony\Component\HttpFoundation\ParameterBag)#8 (1) {
["parameters":protected]=>
array(1) {
["form"]=>
array(1) {
["name"]=>
string(4) "test"
}
}
}
formTypeto generate the form? If so what does thegetName()function return.