thinkphp5: 控制器名的大小写问题

默认情况下,URL是不区分大小写的,也就是说 URL里面的模块/控制器/操作名会自动转换为小写,控制器在最后调用的时候会转换为驼峰法处理。

例如:

http://localhost/index.php/Index/Blog/read
// 和下面的访问是等效的
http://localhost/index.php/index/blog/read

如果访问下面的地址

http://localhost/index.php/Index/BlogTest/read
// 和下面的访问是等效的
http://localhost/index.php/index/blogtest/read

在这种URL不区分大小写情况下,如果要访问驼峰法的控制器类,则需要使用:

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

猜你喜欢

转载自blog.csdn.net/qq_25987491/article/details/80581983