Fields don't have casing conventions that I am aware, the only caveat
is that IDs/foreign keys must be underscore: user_id instead of
userId.

Agreed that underscore file names and tables are weird, I would much
rather have them camel case. Especially seeing as how its a great
standard to have filenames cased the same way as the class name for
easy autoloading, ala Java syntax. The same can go for tables,
especially with HABTM tables.

teams, teamRoster, teams_teamRoster

Is better than:

teams, team_roster, teams_team_roster

I am hoping these are resolved in 2.0 or at least give us the option
of what casing we want.

On Jan 12, 1:46 pm, Matthias <[email protected]>
wrote:
> Hi all,
> does anyone else find it strange, that there is a mixture of
> Underscore and Camelcase in the conventions? I mean, I have a table
> called "workshop_description" (underscore), the filename is
> "workshop_description.php" (underscore), but the model name is
> "WorkshopDescription" (Camelcase) and so are the variables
> ($result['WorkshopDescription']). But then, the field names are
> underscored ("description_text") but don't change, so you are
> accessing them with $result['WorkshopDescription']
> ['description_text']. So why is this, and is it supposed to be fixed
> in the future? I think when it comes to coding guidelines, Camelcase
> writing is preferred over underscore, but something you should always
> avoid is to mix both. Or not? Is it the same with other frameworks?
>
> And when I invent a new field (e.g. in the model's afterFind()),
> should I use an Underscored or Camelcase name? What do you use?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to