I have the following request object and you want to remove 'email_suffix' from the controller before binding to the form. Is it possible?
public 'request' => object(Symfony\Component\HttpFoundation\ParameterBag)[8] protected 'parameters' => array 'registration' => array 'email' => string 's' (length=1) 'email_suffix' => string 'y.com' (length=5) 'password' => string '1234' (length=4) '_token' => string '967d99ba9f955aa67eb9eb004bd331151d816d06' (length=40) 'product_id' => string '2' (length=1) 'product_description' => string '12 month membership' (length=19) 'product_price' => string '6.99' (length=4)
I tried $request->request->remove("registration[email_suffix]");
I can make a request $ request-> request-> remove ("registration") - this works.
I am currently doing this:
$requestReg = $request->request->get('registration'); $requestReg['email'] = $requestReg['email'].'@'.$requestReg['email_suffix']; unset($requestReg['email_suffix']); $request->request->set('registration',$requestReg);
source share