其中定义了代码编写器重写的规则,用于识别控制器,方法,段中的id


Where is define codeigniters rewrite rules for recognizing controller,method,id in segment?

codignitetr如何从url中识别controllername,methodname,id:

https://stackoverflow.com/controllername/methodname/id

最常用的方法是CI_URI->segments();

阅读更多:https://www.codeigniter.com/userguide3/libraries/uri.html#CI_URI::segment

所以,每次/之后你的主持人都是不同的片段。

例如:

//http://stackoverflow.com/controllername/methodname/id
echo $this->uri->segment(1); // controllername
echo $this->uri->segment(2); // methodname
echo $this->uri->segment(3); // id