Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the case access of the TP5 controller

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, Xiaobian will bring you about TP5 controller case access. The article is rich in content and analyzed and described from a professional perspective. After reading this article, I hope you can gain something.

URL case

By default, URLs are case-insensitive, meaning that module/controller/operation names in URLs are automatically converted to lowercase, and controllers are converted to humps on final invocation.

For example:

http://localhost/index.php/Index/Blog/read//is equivalent to http://localhost/index.php/index/blog/read

If you visit the following address

http://localhost/index.php/Index/BlogTest/read//and the following visit are equivalent http://localhost/index.php/index/blogtest/read

In this case-insensitive URL case, if you want to access the controller class of the hump method, you need to use:

http://localhost/index.php/Index/blog_test/read

Module names and operation names are converted directly to lowercase.

If you want URL access to be strictly case-sensitive, you can set it in your app configuration file:

//turn off automatic conversion of controller and operation names in URLs 'url_convert'=>false,

Once automatic conversion is turned off, controller names in URL addresses become case-sensitive. For example, the previous access address would be written as:

http://localhost/index.php/Index/BlogTest/read

But the following URL access is still valid:

http://localhost/index.php/Index/blog_test/read

The following URL access is invalid:

http://localhost/index.php/Index/blogtest/read

Note that routing addresses defined in routing rules are defined by the actual name of the controller name (case-sensitive).

The above is what the case access of TP5 controller shared by Xiaobian is. If there is a similar doubt, please refer to the above analysis for understanding. If you want to know more about it, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report