O'Reilly logo

Programming with CodeIgniter MVC by Yehuda Zadik, Eli Orr

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Miscellaneous naming conventions

CI guidelines have some general naming conventions, such as the following:

  • Your classes, functions, and parameters should have short names, and if constructed from several words they should use the underscore separator as follows:
    // several lowercase words naming with under score
    get_file_properties();
  • When defining a string value, in case the string does not have a parameter to evaluate, we shall use a single comma as follows:
    $my_string   = 'the string';
  • In case we want our string to have a parameter such as $name, we write our string using double quotes:
    $name = 'big string parameter';
    $my_string = "This is a $name ";
  • The Boolean and contacts all should be in upper case:
    $this_vale = FALSE; // While in javascript we ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required