Code style

Comparing #4 with #5

Revision #5 was created by g3ck0 g3ck0 on Nov 9, 2010, 4:58:28 PM.

Highlighted the DON'Ts, added "encapsulated in methods" in Controller section

Content

[...]
### Controller

The controller should contain code for collecting user input, retrieving models from the database, and rendering views.

In a controller there should
**never** be: - HTML code: HTML should be in the view - SQL code: If needed, SQL should be in a model, encapsulate in methods.
- Field names: Field names should be in the view
[...]
HTML code should only be in views.

Views should
**not** contain:

- User input (e.g. $_GET and $_POST): Input should be collected in models in the controllers, never in views.
[...]
Models are used for collecting user inputs, and accessing the database.

In models there should
**not** be:

- User input ($_GET, $_POST): You should write a function that will be called in the controller.
- HTML: HTML should be in a view
[...]