用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1820|回复: 2
收起左侧

[已解决] 关于URI

[复制链接]
发表于 2012-12-3 22:39:34 | 显示全部楼层 |阅读模式
本帖最后由 小竹子哥 于 2012-12-3 23:19 编辑

http://localhost/CI/index.php/k/5
我们都知道用$this->uri->segment(2)获取5,但是http://localhost/CI/index.php/k/5显示的内容在哪写代码?
发表于 2012-12-4 17:26:41 | 显示全部楼层
真心没懂你说的什么意思
发表于 2012-12-4 21:55:35 | 显示全部楼层
仔细看CI手册上关于控制器一节:

http://codeigniter.org.cn/user_g ... ers.html#passinguri

如果你没设置路由(config/routers.php)的话,任何一个URI都有如下约定:
  1. http://localhost/CI/index.php/controller/method/param1/param2
复制代码
controller就是控制器类名,method是你调用的方法,后面的片段就是这个方法的输入参数了。

点评

LZ 看手册吧  发表于 2012-12-5 16:02

本版积分规则