h1. Naming Conventions
Classes should be given descriptive names. Avoid using abbreviations where possible. Use upper case letters as word separators (CamelCase), lower case for the rest of a word. Don't use underbars.
h2. Functions and Methods
Functions and methods should be named using the "studly caps" style (also referred to as "bumpy case" or "camel caps"). The initial letter of the name (after the prefix) is lowercase, and each letter that starts a new "word" is capitalized.
Constants should always be all-uppercase, with underscores to separate words. We highly recommend to use a prefix for the constants. It's a common practice to use IA_ for Subrion CMS project constants.
Note: The true, false and null constants are excepted from the all-uppercase rule, and must always be lowercase.
h2. Global Variables
All the global variables are stored in the $GLOBALS array. All the words in the name are uppercased with underbars as separators. E.g. $GLOBALS['MY_GLOBAL_VAR'].
h2. Hook Names
The name of hooks should be intuitively obvious and should show where hook is placed.
Recommendation name of hook:
- type - the type of hook (php | smarty). It could be PHP or SMARTY hook.
- part - the part of script (front | admin). In what part of script the hook.
- file - the name of file in where hook is placed.
- where - the place of any part of file. (after | before).
- what - the part of file.
phpFrontHeaderBeforeListingFieldsDisplay - It is the common PHP hook in the front end and it is placed before listings fields display action.
h2. Block Names
The name of a block should be intuitively obvious. When you create a new block with content that's kept in an external file it's MANDATORY to use block. prefix in a filename. Here are some examples: