Product SiteDocumentation Site

Joomla Platform 12.1

Coding Standards

A Concise Guide

Edition 1

Joomla! Platform Project


Legal Notice

Copyright © 2011 | Open Source Matters | This material may only be distributed subject to the terms and conditions set forth in the Joomla! Electronic Documentation License (JEDL), V1.0 or later (the latest version is presently available at http://opensourcematters.org/index.php?Itemid=163).
Abstract
A concise guide to the Joomla! Platform coding standards.

Preface
1. Source Code Management
1.1. The Joomla Platform
1.2. Compliance Tool
2. Basic Guidelines
2.1. File Format
2.2. Spelling
2.3. Indenting
2.4. Line Length
2.5. Best Practices
3. PHP
3.1. Language Constructs
3.1.1. PHP Code Tags
3.1.2. Including Code
3.1.3. E_STRICT Compatible PHP Code
3.2. Global Variables
3.3. Control Structures
3.3.1. An if-else Example
3.3.2. A do-while Example
3.3.3. A for Example
3.3.4. A foreach Example
3.3.5. A while Example
3.3.6. A switch example
3.3.7. References
3.3.8. Arrays
3.4. Code Commenting
3.4.1. Comment Docblocks
3.4.2. File DocBlock Headers
3.5. Function Calls
3.6. Function Definitions
3.7. Class Definitions
3.7.1. Class DocBlock Headers
3.7.2. Class Property DocBlocks
3.7.3. Class Method DocBlocks
3.8. Naming Conventions
3.8.1. Classes
3.8.2. Functions and Methods
3.8.3. Constants
3.8.4. Global Variables
3.8.5. Regular Variables and Class Properties
3.9. Exception Handling
3.9.1. Logic Exceptions
3.9.2. Runtime Exceptions
3.9.3. Documenting exceptions
3.10. SQL Queries
A. Revision History
Index