Cannot declare class app\home\controller\Cases because the name is already in use

时间:2017-12-11 13:57:30   收藏:0   阅读:2166

Cannot declare class app\home\controller\Cases because the name is already in use

 

命名空间冲突了 use 模型类的时候使用as别名

同一个页面上 命名空间不同 类名一样就会混淆 参考PHP手册

1.在控制器中使用 as 别名;

技术分享图片

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

2技术分享图片

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

技术分享图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!