Codeigniter MVC Framework PHP

CodeIgniter Compatibility Functions

CodeIgniter Compatibility Functions CodeIgniter provides a set of compatibility functions that enable you to use functions what are otherwise natively available in PHP, but only in higher versions or depending on a certain extension. Being custom implementations, these functions will also have some set of dependencies on their own, but are still useful if your […]

Codeigniter MVC Framework PHP

CodeIgniter Common Functions

CodeIgniter Common Functions CodeIgniter uses a few functions for its operation that are globally defined, and are available to you at any point. These do not require loading any libraries or helpers. is_php($version) Parameters: $version (string) – Version number Returns: TRUE if the running PHP version is at least the one specified or FALSE if […]

Codeigniter MVC Framework PHP

CodeIgniter Auto-loading Resources

CodeIgniter Auto-loading Resources CodeIgniter comes with an “Auto-load” feature that permits libraries, helpers, and models to be initialized automatically every time the system runs. If you need certain resources globally throughout your application you should consider auto-loading them for convenience. The following items can be loaded automatically: Classes found in the libraries/ directory Helper files […]

Codeigniter MVC Framework PHP

Creating Ancillary Classes

Creating Ancillary Classes In some cases you may want to develop classes that exist apart from your controllers but have the ability to utilize all of CodeIgniter’s resources. This is easily possible as you’ll see. get_instance() get_instance() Returns: Reference to your controller’s instance Return type: CI_Controller Any class that you instantiate within your controller methods […]

Codeigniter MVC Framework PHP

Creating Your Own Drivers

Creating Drivers Driver Directory and File Structure Sample driver directory and file structure layout: /application/libraries/Driver_name Driver_name.php drivers Driver_name_subclass_1.php Driver_name_subclass_2.php Driver_name_subclass_3.php Note : In order to maintain compatibility on case-sensitive file systems, the Driver_name directory must be named in the format returned by ucfirst(). Note : The Driver library’s architecture is such that the subclasses don’t […]

Codeigniter MVC Framework PHP

CodeIgniter Libraries

CodeIgniter Libraries All of the available libraries are located in your system/libraries/ directory. In most cases, to use one of these classes involves initializing it within a controller using the following initialization method: $this->load->library(‘class_name’); Where ‘class_name’ is the name of the class you want to invoke. For example, to load the Form Validation Library you […]

Codeigniter MVC Framework PHP

CodeIgniter Helper Functions

Helper Functions Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular category. There are URL Helpers, that assist in creating links, there are Form Helpers that help you create form elements, Text Helpers perform various text formatting routines, Cookie Helpers set and read […]