- Table names are plural and lowercased
- Model names are singular and CamelCased: ModelName, model filenames are singular: model.php
- Controller names are plural and CamelCased with *Controller* appended: ControllerNamesController, controller filenames are named similerly : usersController
- Associations should use the ModelName, and the order should match the order of the foreignKeys: var $belongsTo = ‘User’;
- Foreign keys should always be: table_name_in_singular_form_id: user_id (foreign key) → users (table),
- many-to-many join tables should be named: alphabetically_first_table_plural_alphabetically_second_table_plural: tags_users ,
- columns in many-to-many join tables should be named like other foreign keys: tag_id and user_id ,
- columns named “created” and “modified” will automatically be populated correctly
Wednesday, September 11, 2013
Cakephp-What is the naming convention in cakephp
Labels:
cakephp,
conventions,
naming
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment