【发布时间】:2014-09-10 17:50:45
【问题描述】:
我正在寻求帮助以了解我的 Codeigniter 应用程序经过哪条路径。
在我的 config/routes.php 应用程序文件夹中,我得到了一些数据库生成的路由,如下所示:
$route["user/:any"] = "user/profile/$1";
$route["administration/:any"] = "admin/module/$1";
例如,如果我去 domain.net/user/MYUSERNAME,那么我想知道我是否通过了“user/:any”路线。
有没有可能知道它走哪条路线?
【问题讨论】:
-
我认为这很难做到,也许您想获取类或知道正在使用的方法?
$this->router->fetch_class();和$this->router->fetch_method();。或者您可以使用简单的$this->uri->segment(n);按功能(由您创建)构建您的路线
标签: php codeigniter