cakephp - naming tables and using cake bake

后端 未结 1 351
余生分开走
余生分开走 2021-01-27 09:54

I\'m having some weird behaviour from the cake console and I can\'t figure out what could possibly be wrong!

I\'ve used the cake bake console before and not had any prob

相关标签:
1条回答
  • 2021-01-27 10:32

    Model names should be unique...

    As a general rule, don't use names for your tables that would result in a model class name that equals an existing class name, Folder for example is a utility class shipping with CakePHP, and this will cause problems with autoloading as you've experienced.

    This is a problem that should/will be fixed with CakePHP 3, where namespaces are being used.

    ...and singular

    archives being turned into archife sounds like it could be an Inflector bug/conflict, try

    debug(Inflector::singularize('archives'));
    

    It's working fine for me using CakePHP 2.5.1, ie it returns archive as expected, so I'd suggest to upgrade your CakePHP version, and report it as a bug in case it's happening with a recent version.

    0 讨论(0)
提交回复
热议问题