在学习thinkphp过程中碰到以下错误
模块不存在:user_controller
最后发现是因为config.php配置文件中的controller_suffix选项被设置为"true"了。
这个设置为true的话,tp5会在我们输入的url中的控制器后面添加一个_controller后缀
使用默认路径localhost访问到的实际上是localhost/index.php/index/index_controller/index
而index_controller这个控制器我们并没有定义,并不是默认的index控制器,。所以直接在地址栏输入localhost,会无法访问。
实际上是localhost
解决方法:新定义一个IndexController控制器或把controller_suffix的值设置为false