Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cakephp 2 redirect url with hashtag

I'm trying to redirect an url containing a hashtag(#) with cakephp's redirect controller function.

When I use this code it url encodes the hashtag

$this->redirect(array('action' => 'index',$menuItem."#article_id_".$created_id));

output: http://something.com/link%23article_id_62

Is there a way that

like image 723
waterschaats Avatar asked Dec 27 '22 08:12

waterschaats


1 Answers

You need to use the # key:

$this->redirect([
    // ...
    '#' => 'article_id_' . $created_id,
]);
like image 53
deizel Avatar answered Jan 06 '23 08:01

deizel