TP5的URL大小写问题

TP5中的有控制器和操作名自动转换的功能,但是不知道为什么官方没有把这个是否需要自动转换大小写的功能也应用到模块中导致我的模目出现大小时的时候在liunx环境下运行不正确。

比如,我增加了一个userCenter的用户中心的模块。

application

           |-----userCenter

这时使用http://127.0.0.1/userCenter是无法正常方法的,

修改方法如下

打开thinkphp/library/think/App.php文件,找到第336行

 $module    = strip_tags(strtolower($result[0] ?: $config['default_module']));

修改为

if($convert){ //增加模块的大小写是否自动转换的功能
            	$module    = strip_tags(strtolower($result[0] ?: $config['default_module']));
            }else{
            	$module    = strip_tags($result[0] ?: $config['default_module']);
            }

这样就可以和控制器和操作名一同处理大小写的问题了

猜你喜欢

转载自blog.csdn.net/emtit2008/article/details/76195034