Custom routing rules in the CI framework and custom routing in the ci framework. Custom routing rules in the CI framework. in the ci framework, a URL corresponds to the class in the controller and the method in the class, for example, www. custom routing rules in the t CI framework and custom routing in the ci framework
In the CI framework, a URL corresponds to the class in the controller and the method in the class, for example:
www.test.com/user/info/zhaoyingnan
User corresponds to the user class in the controller, info corresponds to the info method in the user class, and zhaoyingnan is the passed parameter.
If I do not want to use the URL www.test.com/user/info/zhaoyingnan,
Instead, it is changed to www.test.com/member/zhaoyingnan,
In this case, you need a custom routing rule,
When the URL is www.test.com/member/zhaoyingnan, the actual request is www.test.com/user/info/zhaoyingnan.
Here, the actual expression I recommend is not mentioned in other methods:
Application/config/routes. php
2. add the following operations:
/*** @ Author zhaoyingnan * custom routing rule **/$ route ['Member/(\ w + )/? $ '] = 'User/info/$1 ';
Custom routing rules in the http://www.bkjia.com/PHPjc/1060691.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1060691.htmlTechArticleCI framework, ci framework custom routing in the CI framework, a URL and its corresponding controller class and the method in the class is one-to-one correspondence, such as: www. t...