【发布时间】:2019-05-25 11:03:30
【问题描述】:
基本网址:http://localhost/f1/
我在 URL 中传递参数,例如: http://localhost/f1/user1
我正在尝试打印
function index(){
echo $this->uri->segment(2);
}
我想在控制器中打印User1。如何做到这一点?
【问题讨论】:
-
现在,有什么问题?
-
404 未找到显示。
-
你设置你的
base_url了吗? -
是的,上面我已经提到了。 localhost/f1
-
尝试获取
User1作为函数参数function index($url1){ echo $url1;}
标签: php codeigniter