开发者社区> 问答> 正文

thinkphp控制器访问报错,求解??报错

1.新手误喷(thinkphp3.2)

http://localhost/thinkphp/index.php/Home/index/(访问正常)

后在Controller文件夹新建UserController.class .php,内容改为

<?php
namespace Home\Controller;
use Think\Controller;
class UserController extends Controller {
    public function index(){
    echo 'sssss';
    }
    
}
http://localhost/thinkphp/index.php/Home/User/(访问报错)

无法加载控制器:User

展开
收起
爱吃鱼的程序员 2020-06-16 13:51:19 441 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    UserController.class.php



    class后面多了个空格

    膜拜,火眼金睛。

    引用来自“金三胖”的评论

    UserController.class.php



    class后面多了个空格

    2020-06-17 13:18:22
    赞同 展开评论 打赏
问答分类:
PHP
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载