Codeigniter - 如何获取和更改 uri 段然后重定向?
在我的 Web 应用程序中,我有一个如下所示的 url:
http://mydomain.com/search/index/list/for-sale/london/0/0/0/0
我想使用 uri 类并重定向以将 $this->uri->segment(3);
更改为 地图
然后重定向。
因此,一旦重定向并且该段已更改,网址将如下所示:
/search/index/map/for-sale/london/0/0/0/0
我将如何执行此操作?
In my web application I have a url that looks like the following:
http://mydomain.com/search/index/list/for-sale/london/0/0/0/0
I would like to use the uri class and redirect to change $this->uri->segment(3);
to map
and then redirect.
So that once redirected and the segment has been changed the url would look like:
/search/index/map/for-sale/london/0/0/0/0
How would I go about doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它可能需要一些额外的检查,但这将是一个简单的方法:
It may need some extra checks, but this would be a simple approach: