I want to know if it is possible to modify the value of the parameter of the request.
But i don't know how to do this.
I try with
$requestContent = $this->getRequest()->request->get('tactill_customerbundle_customertype');
Next I use
$request->request->replace()
But I don't how to use this method in my case.
Thanks
The replace
method replaces all of the parameters in the request, so you probably do not want to do that.
I would use the set
method instead - So you can do:
$request->request->set('tactill_customerbundle_customertype', $newValue)
You can read more in the Symfony2 documentation (http://api.symfony.com/2.0/) - you are looking for Symfony\Component\HttpFoundation\Request
(which is the $request
variable), which then returns a Symfony\Component\HttpFoundation\ParameterBag
when you call the request()
method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With