- Files MUST use only UTF-8 without BOM for PHP code.
- Code MUST use tabs for indenting, not spaces.
- Class names MUST be declared in
- Class names should be in the following format:
- Class constants MUST be declared in all UPPER_CASE with underscore separators.
- Method names MUST be declared in
- Property names MUST be declared in
- Property and Methods names MUST start with an initial underscore
_if they are private.
- Always use `elseif` instead of
- PHP code MUST use the long
<?php ?>tags; it MUST NOT use the other tag variations such as
- In case file contains PHP only it should not have trailing
- Do not add trailing spaces to the end of the lines.
Every declared class or function should contain a docblocks header with exception of overwritten function that do not add new functionality (eg
A block should at least contain a short description
@return must declare types as boolean, integer, string, array or null. You can use a class names as well such as
GO_Base_Db_ActiveRecord. For a typed arrays use
When a function or class is deprecated the
@deprecated tag should be used (Netbeans can hide all deprecated functionality in the code completion)
All models should go into the `model` folder of the module folder
The items of a model class should be in the following order:
- Constants (eg
- Properties/attributes (eg
- Overwritten functions (eg
- Get/Set Methods (eg
- Functions (eg
If class name is not in the format
GO_<MODULENAME>_Model_<FILENAME> not the the class will never be able to autoload
<MODULENNAME> MUST be in Firstcaps without special characters
<FILENAME> MUST be StudlyCaps
All controllers should go into the controller folder of the module
The items of a controller class should be in the following order:
- Properties ( eg.
- Overwritten function (eg.
- Actions (eg.
Controller action should only have one parameter named $parmas this is the http request its REQUEST array Controllers that will return JSON data should extend `GO_Base_Controller_AbstractJsonController`
Prevent using properties in a class, an action method is 1 script run
Prevent private methodes, use them for code that should be shared among actions. In must cased there is code in the controller that is functionality of a class.
All views should go into the
views/<theme>/ folder of the module