I'm in a Controller and I want to redirect back to a URL, say /home/news/example#comment1423
How can I add the hash in to the return params?
return $this->redirect(
$this->generateUrl("news_view", array("permalink" => "example"))
);
The simplest solution would probably be concatenation:
$url = $this->generateUrl("news_view", array("permalink" => "example"));
return $this->redirect(
sprintf('%s#%s', $url, 'comment1423')
);
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