CI怎么取出URL中的变量
菜鸟请教大神,CI怎么取出URL中的变量$this->uri->segment(4) Closer 发表于 2015-2-23 22:39
路徑 : http://localhost/jp/index.php/student/toevaluate/1
控制器 : student
幽默!
請參考CodeIgniter手冊中的URI 類的$this->uri->uri_to_assoc(n)例子。
http://codeigniter.org.cn/user_guide/libraries/uri.html
為何不看手冊?
补充:http://localhost /jp/index.php/student/toevaluate/course_id/1,怎么取出course 补充:http://localhost/jp/index.php/student/toevaluate/course_id/1,怎么取出course_id这个值1,万分感谢! buaa_hyz 发表于 2015-2-23 11:12
补充:http://localhost/jp/index.php/student/toevaluate/course_id/1,怎么取出course_id这个值1,万分感 ...
路徑 : http://localhost/jp/index.php/student/toevaluate/1
控制器 : student
方法 : toevaluate
參數 : 1
請在方法 () 內加入自定義變數名稱
例如 ($course_id = 0) //預設為 0
然後在該方法內使用 $course_id 來取得你的參數
燃雲 发表于 2015-2-24 06:30
幽默!
請參考CodeIgniter手冊中的URI 類的$this->uri->uri_to_assoc(n)例子。
我比較好奇,甚麼情況下才會用到那種功能
页:
[1]