cakephp 创建拼写错误的模型类及其文件名
我有一个名为“abuses”的数据库表。在烘焙应用程序时,烘焙命令将其控制器类名命名为“abuses”,文件名命名为“abuses_controller.php”,但是当我烘焙模型时,文件名是“Abus.php”,类名是“Abus”。
这是 cakePHP 中的错误吗?或者我错过了什么?
有人遇到过同样的问题吗?
谢谢
I have a database table named 'abuses'. While baking the application the bake command named it's controller classname as "abuses" and filename as "abuses_controller.php" but when I baked the model the filename was "Abus.php" and classname was "Abus".
Is that a bug in cakePHP ? or did I miss something ?
Has anyone encountered the same problem yet ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果 Cake Inflector 出错,您可以添加自定义变形规则(它只是人类的,单数“~e”对于复数“~es”可能并不常见):
http://book.cakephp.org/view/953/Inflections
You can add your custom inflection rules if the Cake Inflector gets it wrong (it's only human, and a singular '~e' is probably uncommon for a plural '~es'):
http://book.cakephp.org/view/953/Inflections
由于词形变化,请检查此 http://book.cakephp.org/view/953/Inflections< /a>
its due to inflections check this http://book.cakephp.org/view/953/Inflections
看一下 CakePHP 的 Inflector 类。
Take a look at CakePHP's Inflector class.