cakephp 2 redirect url with hashtag

ⅰ亾dé卋堺 提交于 2020-01-14 12:37:05

问题


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


回答1:


You need to use the # key:

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


来源:https://stackoverflow.com/questions/8615516/cakephp-2-redirect-url-with-hashtag

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!