This should be simple, and I've been searching all over Google, but I keep coming up with 'route' related advice.
I just want to perform a redirect to the same page and modify one of the query string parameters (either to clear one or set one).
I can't see how to do this anywhere.
An option could be to completely generate the URL manually and use this I guess, but that doesn't seem a very good method:
$this->router->generate("http://domain.com?a=1")
I hope I understand what you intend to do... In your controller (?) use
$this->generateUrl(
$request->attributes->get('_route'),
array_merge(
$request->query->all(),
array('param' => 'val') // change the param
)
);
to generate the url.
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