Model Naming conflict in CakePHP

旧时模样 提交于 2020-01-15 17:47:32

问题


Does anybody know if CakePHP 2.x has a naming conflict between a Model named File.php and CakePHP File classes?

Thanks in advance!


回答1:


Yes. There's a utility class File and the lack of namespacing in CakePHP 2.x means you can't have a second class sharing the same name. You will need to find an alternative name for your model, e.g. Document.

In CakePHP 3.x this issue is removed as it uses namespaces.



来源:https://stackoverflow.com/questions/34212753/model-naming-conflict-in-cakephp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!