Cannot declare class apphomecontrollerCases because the name is already in use

与天地兮比寿,与日月兮齐光。这篇文章主要讲述Cannot declare class apphomecontrollerCases because the name is already in use相关的知识,希望能为你提供帮助。
Cannot declare class app\\home\\controller\\Cases because the name is already in use 
命名空间冲突了 use 模型类的时候使用as别名
同一个页面上 命名空间不同 类名一样就会混淆 参考php手册
1.在控制器中使用 as 别名;

Cannot declare class apphomecontrollerCases because the name is already in use

文章图片

2,在控制器中自定义模型
2
Cannot declare class apphomecontrollerCases because the name is already in use

文章图片

3,控制器中调用“getBy+字段”方法
Cannot declare class apphomecontrollerCases because the name is already in use

文章图片

【Cannot declare class apphomecontrollerCases because the name is already in use】 

    推荐阅读