What is CodeIgniter, and how does it work?

What is CodeIgniter, and how does it work?

What is CodeIgniter?

CodeIgniter is a free, open-source, easy-to-use, object-oriented PHP web application framework, providing a ready-to-use library to use with your own PHP applications. For example, there is a Database API to make it easier and more convenient to execute SQL queries, such as SELECT, UPDATE, DELETE, INSERT, etc., without having to create a lot of repetitive code yourself. This is how an application framework is useful in application development.

CodeIgniter is object-oriented

Using CodeIgniter requiring knowledge of using the object-oriented programming technique in order to be able to use CodeIgniter effectively, and to understand what happens when you are using certain features in CodeIgniter.

But, what is object-oriented programming?

It’s quite difficult to explain object-oriented programming because from a conceptual point of view, it is difficult to understand. However, the main purpose of object-oriented programming is to make application development easier, especially as applications become bigger, with large structures. Object-oriented programming allows application code and logic to be easier to understand, structured and coherently in place, making it easier to develop and extend your application’s features and functionality. With procedural programming (which is merely standard code executed line-by-line with the use of functions as a container for code that help prevent repetitiveness and “reinventing the wheel”), applications can become a mess if they aren’t developed in a way where everything is well laid out, coherent and structured, and can be more difficult to extend and add new features and functionality to your applications later on. With object-oriented programming, in a way, you are forced to be coherent and have your code structured correctly.

Classes and Methods

What are classes and methods? These are the first concepts you’ll be introduced to if you are learning object-oriented programming from most books or online resources. Say you’re creating a framework. You’ll have different classes for different parts of your framework. One being a “Database Class”, one being an “E-mail Class”, and so forth. Of course, in this case, the Database Class is like the CodeIgniter Database Class, providing a set of ready-made methods for you to use so you don’t have to create them yourself in order to execute certain application logic, such as inserting, updating and removing database records quickly, without having to “reinvent the wheel”.

The methods are what contain the application logic, and the class merely holds many related methods together. And this is exactly how your applications would work with the use of the object-oriented programming techniques.

How does CodeIgniter work?

CodeIgniter has a very extensive user guide, which is much better than documentation on some other frameworks, such as CakePHP (which is another PHP framework).

CodeIgniter has classes and helpers.


Classes contain a collection of methods and properties (properties are essentially variables in an object-oriented context).

For example, here is an example using the Database library within CodeIgniter:


In any application you make using CodeIgniter, your own classes inherit (or extends) the CodeIgniter class, and so this is why the $this variable is used, which refers to the current class/object. So to call another method within your class, you would use $this->method_name().


Helpers contain ordinary PHP functions. Such as the Form Helper.

Other interesting features of CodeIgniter

While this is by no means unique to CodeIgniter, and other web application frameworks use this approach to application development, CodeIgniter primarily uses the Model, View, Controller (MVC) approach to application design and development. It essentially separates application logic from the application design/view. The application logic is the Controller, whereas the application design/view is the View. The Model is for database interactions. There are more complex scenarios where the MVC approach is used, but for basic to intermediate CodeIgniter applications, the Model would contain database interactivity logic of sorts.

Active Record

When you saw an example of using the Database Class above, that code is actually part of the Active Record Class that is part of the Database library.

Active Record is where your work can be shortened by providing an easy and convenient way to execute certain SQL queries without having to write out the entire SQL query yourself. Active Record essentially allows information to be updated, retrieved, added and removed conveniently.

More information on CodeIgniter

The CodeIgniter framework works on all of our shared and reseller servers, and can be installed on pretty much any server with PHP installed. As of writing, CodeIgniter requires PHP version 5.1.6 or higher and obviously a database will be required for any database-driven PHP application (as of writing, MySQL 4.1 or higher). CodeIgniter also supports PostgreSQL, Oracle, SQLite and ODBC. For up to date server requirements, see the CodeIgniter user guide.

Visit the CodeIgniter website

Ben Stones



  1. Pingback:Weeds Season 8 DVD BoxSetchuck dvd or calling other people you know | Marijuana for MRSA

  2. Pingback:http://wwwvanessabrunosacrcom/Sac vanessa bruno à côté du photographe | Marijuana for MRSA

  3. Pingback:driver taylor made r11golf equipment fighting is often a small section of | Paleciak.com

  4. Pingback:american horror story season 1 dvdcsi miami dvd here’s the synopsis for th | Marijuana for MRSA

  5. Pingback:cheap dvdscsi miami dvd all i need for christmas is my hdtvspun1dj | Marijuana for MRSA

  6. Pingback:wholesale golfwhlesale golf clubs navigating the institution volleyball re | Marijuana for MRSA

  7. Pingback:?????? 910 d2 ?????????????180????????-spu

  8. Pingback:cheap ralph laurencatcher Real Estate Amazing Homesspun1 o9 | Writings of the Internet

  9. Pingback:ralph lauren femme pas cherA buzz about the Innspun2 v0 | What do you have to say

  10. Pingback:ping raptureirons golf that can assist you following roundspun1 2j | Marijuana for MRSA

  11. Pingback:razr callawaygolf bags meaning the episode ends there | Marijuana for MRSA

  12. Pingback:taylor made uknike boots finally released to proselytize yet again in 1993 | Marijuana for MRSA

  13. Pingback:eiof outlets of louis vuitton oyfq

  14. Pingback:cheapest beats dremonster earphones go operating l3 | acupuncture and more

  15. Pingback:g20 試打 golf equipment donation is going to be utilized to provide shelter | Article Servant

  16. Pingback:taylormade r11s golf one example isspun2spun2spun2 | Marijuana for MRSA

  17. Pingback:sun glasses mensralph lauren jackets divided with the ending price of | Marijuana for MRSA

  18. Pingback://wwwmanagingcreativitycom | Paleciak.com

Leave your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.