dongyang2229 2013-02-02 08:54
浏览 30
已采纳

为什么我的路由codeigniter没有去正确的动作控制器?

Here my route

$route['posts/(:any)'] = 'posts/get_show/$1';
$route['posts/(:any)/dosomething'] ='posts/get_dosomething/$1';

Controller

public function get_show($id)
public function get_dosomething($id)

With the link posts/1/dosomething, route always points to the action get_show, it never goes to get_dosomething

Any idea how to fix it ? Thanks

  • 写回答

2条回答 默认 最新

  • duandang6111 2013-02-02 08:56
    关注

    you must first route like this

    $route['posts/(:any)/dosomething'] ='posts/get_dosomething/$1';
    $route['posts/(:any)'] = 'posts/get_show/$1';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 informer代码训练自己的数据集,改参数怎么改
  • ¥15 请看一下,学校实验要求,我需要具体代码
  • ¥50 pc微信3.6.0.18不能登陆 有偿解决问题
  • ¥20 MATLAB绘制两隐函数曲面的交线
  • ¥15 求TYPCE母转母转接头24PIN线路板图
  • ¥100 国外网络搭建,有偿交流
  • ¥15 高价求中通快递查询接口
  • ¥15 解决一个加好友限制问题 或者有好的方案
  • ¥15 急matlab编程仿真二阶震荡系统
  • ¥20 TEC-9的数据通路实验