开发者

Scaffold is ignoring class file in CakePHP

开发者 https://www.devze.com 2023-01-02 05:00 出处:网络
when using scaffolding on开发者_StackOverflow中文版 a controller the views render fine and the app even attempts to insert the data; the problem is that the scaffold is completely ignoring the relatio

when using scaffolding on开发者_StackOverflow中文版 a controller the views render fine and the app even attempts to insert the data; the problem is that the scaffold is completely ignoring the relations I'm defining in my model class, in fact it's ignoring the class entirely as I can delete the file and the controller still scaffolds and render the crud from the table.

Has this ever happened to you?

Edit to add: Ok this just got weirder, I check my naming conventions and they are allright and to make things worse it's not only happening on scaffolding, I just created a simple table: id, name and country_id and it's ignoring my model file here too even without scaffolding.

Added more info for this question here: https://stackoverflow.com/questions/2945879/why-are-some-classes-created-on-the-fly-and-others-arent-in-cakephp-1-2-7


This probably means you have some sort of naming problem with your model and Cake is not using it to begin with, but makes up its own on the fly. Cake's automagic only works if you follow its naming conventions.

It's hard to say without more details though.


Sometimes, Cake caches too much for your own good. Try deleting the contents of the tmp/cache/ dir inside the cake dir structure and see if the errors keep appearing.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号