Skip to content

Getting Started

javis edited this page Nov 5, 2011 · 2 revisions

Class Names and File Location

Class names in linxphp follow a strict convention to facilitate autoloading.

The following conventions apply:

  1. The PHP file name must be the same as the class name.
  2. All class file names and directory names are lowercase.
  3. All classes should be in the application/classes directory.

Coding Standards

In order to produce highly consistent source code, we ask that everyone follow the coding standards as closely as possible.

Naming Conventions

Classes

We use CamelCase for classes:

class AdminController extends Controller{ 
Functions and Methods

Functions should be all lowercase, and use under_scores to separate words:

function drink_beverage($beverage)
{
Variables

All variables should be lowercase and use under_score, not camelCase:

// Correct:
$foo = 'bar';
$long_example = 'uses underscores';
 
// Incorrect:
$weDontWantThis = 'understood?';
You can’t perform that action at this time.