Sunday, January 24, 2010

Basic Stature of CakePHP and rules

Now lets discuss about some rules and mvc framework stature of cakePHP, for create a database application we need to follow bellow things

1) define data model
2) controller file : here we are writing database queries
3) and query results

Table & field name convention

1)create your database
2) table name : lower case, plural, multi-word tables to be separated by underscore
Example : table name articles
3) Each table must have one primary key to named id ( auto increment not null)
4) filed name : lower case can use under score for separation and multi-word field
4) and related table names

Model name convention

Model class name are camelcased and singular ( like article , MyClass etc) it should be database table name
Model file names are lower case, multi – word class is to be separated by underscore
Model files are saved under app/models folder


No comments: