|
Content with label coding in Development (See content from all spaces)
Related Labels:
developer, components, standards, api, mambo45, extensions, mambo46, classes, mambots, security, methods, state, transfer, modules, functions, mambo, events, rest, representational
Function Definitions
Function declarations follow the "one true brace" convention: <?php function fooFunction( $arg1, $arg2 = '' ){ if (condition) return $val; } ?> Arguments with default values go at the end of the argument list. Always attempt to return a meaningful value from a function if one ...
Other labels:
developer, standards
|
Function Calls
Functions should be called with no spaces between the function name, the opening parenthesis, and the first parameter; spaces between commas and each parameter, and no space between the last parameter, the closing parenthesis, and the semicolon. Here's an example: <?php $var = foo( $bar ...
Other labels:
developer, standards
|
Control Structures
include if, for, while, switch, etc. Use of the "elseif" construct is permitted but highly discouraged in favour of the "else if" combination. Here is an example if statement, since it is the most complicated of them: <?php if ((condition1) (condition2)) elseif ((condition3) && (condition4)) else { if (condition5) defaultaction ...
Other labels:
developer, standards
|
Indenting and Line Length
Use an indent of 4 spaces, with no tabs. If you use Emacs to edit PEAR code, you should set indenttabsmode to nil. Here is an example mode hook that will set up Emacs according to these guidelines (you will need to ensure ...
Other labels:
developer, standards
|
Mambo Coding Standards
Mambo Coding Standards v.1.0 March 2007 Updated: Header Comment Blocks November 2007. Introduction The Mambo Coding Standards apply to code that is part of the official Mambo distribution. This document is based on the PEAR Coding standards. http://pear.php.net ...
Other labels:
developer, standards
|
|
|