Problem with linking models containing multiple words in CakePHP

I had two models, “Example” and “ExampleModel”, linked with belongsTo – hasMany relationship.

The problem was, after baking, the dropdown selection for ExampleModel in Example’s add and view pages were totally blank. Yet, in the index page, the data is shown (which means that relationship is established correctly).

So my lesson is that avoid multiple-worded model names as much as possible…because the baking will generate the variable name with uppercase letter mixed in (because that’s the standard naming convention for the multi-worded model names in CakePHP). So every time you bake it, you need to manually adjust that variable names.

Categories

Meta

About Me

Work full time at Cazbah as Lead Web Developer, building websites for small businesses. I get to be responsible for almost all aspects of web developments - server management, design, programming, database, etc..
When I'm not at work, I torture myself training for triathlon races. I also enjoy scuba diving, surfing, crafting, cooking, and most importantly, eating.
I am owned by two dogs, Hana and Goemon Jr.