Become Our Fan on Social Sites!

Facebook Twitter

Google+ RSS YouTube

Thursday 13 March 2014

CodeIgniter Reserved Names

This post is about Reserved Names in CodeIgniter. Reserved names are names that are used in internal operations and developer can not use that names.

Reserved Words In CodeIgniter
Reserved Names CodeIgniter

In CodeIgniter, some controller names, function names, variable names, and constant names are reserved, so developer/programmer can not use that names.

1. Reserved Constants In CI


Constants are variable names with fixed/constant value. It should be in capital letter. Constants are fixed, we can not change value of constants.


Following are list of reserved constants in CodeIgniter:
  • ENVIRONMENT
  • EXT
  • FCPATH
  • SELF
  • BASEPATH
  • APPPATH
  • CI_VERSION
  • FILE_READ_MODE
  • FILE_WRITE_MODE
  • DIR_READ_MODE
  • DIR_WRITE_MODE
  • FOPEN_READ
  • FOPEN_READ_WRITE
  • FOPEN_WRITE_CREATE_DESTRUCTIVE
  • FOPEN_READ_WRITE_CREATE_DESTRUCTIVE
  • FOPEN_WRITE_CREATE
  • FOPEN_READ_WRITE_CREATE
  • FOPEN_WRITE_CREATE_STRICT
  • FOPEN_READ_WRITE_CREATE_STRICT

2. Reserved Variables In CI

Variables are names given to the values. We can change value of variables.

There are following reserved variables in CodeIgniter:
  • $config
  • $mimes
  • $lang

3. Reserved Functions In CI

Function is a few line of codes and reduces redundancy in application.

In CodeIgniter there are following reserved functions that developer / programmer can't create such functions:
  • is_really_writable()
  • load_class()
  • get_config()
  • config_item()
  • show_error()
  • show_404()
  • log_message()
  • _exception_handler()
  • get_instance()

4. Reserved Controller In CI

In CodeIgniter, controller is a special class and works as intermediary between views and model.


Following are the reserved controller names in CodeIgniter, programmer / developer can't use it:
  • Controller
  • CI_Base
  • _ci_initialize
  • Default
  • index

Conclusion:

Above listed names are reserved names in CodeIgniter, so developer / programmer should have to take care about naming controller name, function name, variable name, or constant name.

0 comments :

Post a Comment