0

这是我的路线

$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

知道如何解决吗?谢谢

4

2 回答 2

2

你必须首先像这样走

$route['posts/(:any)/dosomething'] ='posts/get_dosomething/$1';
$route['posts/(:any)'] = 'posts/get_show/$1';
于 2013-02-02T08:56:43.753 回答
0

因为posts/1/dosomething总是落在 $route['posts/(:any)'] 之下。更改您的路线条件之一

于 2013-02-02T08:59:47.180 回答