这是我的路线
$route['posts/(:any)'] = 'posts/get_show/$1';
$route['posts/(:any)/dosomething'] ='posts/get_dosomething/$1';
控制器
public function get_show($id)
public function get_dosomething($id)
使用链接posts/1/dosomething
,路线始终指向操作get_show
,它永远不会转到get_dosomething
知道怎么解决吗?感谢
答案 0 :(得分:2)
你必须先这样路线
$route['posts/(:any)/dosomething'] ='posts/get_dosomething/$1';
$route['posts/(:any)'] = 'posts/get_show/$1';
答案 1 :(得分:0)
因为posts/1/dosomething
总是落在$ route ['posts /(:any)']之下。改变你的一条路线条件