Cakephp 2 redirect url with hashtag

I am trying to redirect a url containing a hashtag (#) with cakephp relay controller function.

When I use this code url encodes hashtag

$this->redirect(array('action' => 'index',$menuItem."#article_id_".$created_id)); output: http://something.com/link%23article_id_62 

Is there any way that

+4
source share
1 answer

You need to use the # key:

 $this->redirect([ // ... '#' => 'article_id_' . $created_id, ]); 
+10
source

Source: https://habr.com/ru/post/1387730/


All Articles