route问题,如何隐藏 url中的 /id/

浏览:2104 发布日期:2014/08/20 分类:求助交流 关键字: route url
刚刚开始接触thinkphp 3.2版本;

3.2版本以前,routing定义如:
'/^Topic\/(\d+)$/is' => 'Topic/details?id=:1',

url示例:

http://domain/topic/1;
http://domain/topic/add;
http://domain/topic/edit/1;
http://domain/topic/delete/1
都能正常访问;

3.2版本之后,依旧使用如上routing,
编辑和删除的链接不改变:
http://domain/topic/edit/1;
http://domain/topic/delete/1

可以正常访问,但是发现$_GET一直为空,

链接地址改为:
http://domain/topic/edit/id/1;
http://domain/topic/delete/id/1

一切正常。

请问如何做最小改动,隐藏掉上边url中的 "/id" ,并且可以拿到$_GET中的数据?

如能指教源码中做了哪些的改变就更好了:)
最佳答案
评论( 相关
后面还有条评论,点击查看>>