我正在开发一个小型Web应用程序。在我的应用程序中,我采用以下方法。
I am working on a small web application. In my application I follow the following approach.
系统小概况
如果客户端的员工希望登录系统,则网址格式应为:
If the employees of the client want to login into the system then the url pattern should be like this :
(www.example/ ibm /用户/登录) ibm-是客户端 用户-是控制器 登录-是用户控制器的方法
(www.example/ibm/user/login) ibm - is the client user - is controller login - is method of user controller
如何实现?
推荐答案感谢Sundar的建议。 我们可以通过在codeigniter的核心中进行一点改动来实现此目的。
Thanks Sundar for your advice. We can achieve this just by little hack in core of codeigniter.
在第270行添加此代码
Add this code at line 270
$ x = $ segments; $ a = 1; for($ i = 0; $ i<(count($ segments)-1); $ i ++) { $ segments [$ i] = $ x [$ a]; $ a ++; }
$x=$segments; $a=1; for($i=0;$i<(count($segments)-1); $i++) { $segments[$i]=$x[$a]; $a++; }
更多推荐
在同一CodeIgniter 2.x应用程序上使用多个数据库并出现URI路由问题
发布评论