dongyu9894 2016-09-05 10:51
浏览 13

/ 1?seller_id = 2在codeigniter中重新路由

My URL is http://localhost/goconsult/admin/customer-list/1?seller_id=2

How to re-route this URL in CodeIgniter ?

  • 写回答

1条回答 默认 最新

  • duanji9311 2016-09-05 10:59
    关注

    Try something like

    $route['admin/customer-list/(:any)'] = 'admin/customer-list/index/$1;
    

    Or if url is like

    http://localhost/goconsult/admin/customer-list/1/?seller_id=2
    
    $route['admin/customer-list/(:any)/(:any)'] = 'admin/customer-list/index/$1/$2;
    

    You could just use uri segments instead of query in url

    http://localhost/goconsult/admin/customer-list/1/2
    

    So now the seller id would be

    $this->uri->segment(4);
    
    echo $this->uri->segment(4);
    

    http://www.codeigniter.com/user_guide/general/routing.html

    http://www.codeigniter.com/user_guide/libraries/uri.html#CI_URI::segment

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?