Cannot declare class app\home\controller\Cases 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 别名;

2,在控制器中自定义模型

2

3,控制器中调用“getBy+字段”方法

 

posted @ 2017-12-11 11:30  码农编程进阶笔记  阅读(141)  评论(0编辑  收藏  举报
返回顶部 有事您Q我