Model Naming conflict in CakePHP

2019-08-14 06:07发布

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条回答
Evening l夕情丶
2楼-- · 2019-08-14 07:02

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.

查看更多
登录 后发表回答