Choosing a good PHP frameworks can help you develop complex Rich Internet Applications quickly, with a best practices oriented approach, and saving a lot of time reusing code snippets that are already available. There are a lot of interesting PHP frameworks you can choose for your next web project. Today we will focus on one of my favorite PHP Frameworks: CodeIgniter.
CodeIgniter is a powerful, high-performance, open-source PHP framework that helps you author PHP applications rapidly. CodeIgniter is known for having a light footprint, there by reducing your server’s work.

CodeIgniter has an exciting online manual, a couple of helpful video tutorials and an active user forum.

In today’s post will attempt to show you the basics of setting up the CodeIgniter framework, including step by step tutorials showing you how to build awesome applications that uses the MVC approach the easy way.

Get started with CodeIgniter

1. Why CodeIgniter?

The simplicity of setting things up and getting an actual webpage that processes something online is quite easy. CodeIgniter uses the MVC or Model View Controller architectural pattern. MVC is a software approach that separates application logic from presentation. In practice, it permits your web pages to contain minimal scripting since the presentation is separate from the PHP scripting.

CodeIgniter has probably the best definition of each the model, view, and controller.

  • - The Model represents your data structures. Typically your model classes will contain functions that help you retrieve, insert, and update information in your your database.
  • - The View is the information that is being presented to a user.
  • - The Controller serves as an intermediary between the Model, the View, and any other resources needed to process the HTTP request and generate a web page. The controller is the top level file for each page that allows you to include database requests in the form of ‘Models’ and templates as ‘Views’.

By using this practice your code is tidy and re-usable.

Get started with CodeIgniter

Source: Get started with CodeIgniter

2. Installing and Configuring CodeIgniter

First you need to download CodeIgniter from http://www.codeigniter.com/.

  • 1. Unzip the package.
  • 2. Rename the “CodeIgniter” folder to your application name “app”. Upload the CodeIgniter folders and files to your PHP and MySQL enabled server. Normally the index.php file will be at your root.
  • 3. Open the application/config/config.php file with a text editor and set your base URL.
    $config['base_url'] = "http://localhost/app/";
    
  • 4. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
    $db['default']['hostname'] = "localhost";
    $db['default']['username'] = "root";
    $db['default']['password'] = "root";
    $db['default']['database'] = "helloworld";
    $db['default']['dbdriver'] = "mysql";
    

    This code connects to a MySQL database called “helloworld” on a localhost with the username “root”, and the password, “root”.

Please visit this tutorial to show you the basics of setting up the framework, including how to build a basic hello world application that uses the MVC approach.

Source: Everything You Need to Get Started With CodeIgniter

3. Building Your First CodeIgniter Application

Creating web applications with CodeIgniter (CI) is quick and easy because CI handles a lot of the typical application requirements right out of the box (like session management, database abstraction and file uploading). And while CodeIgniter does handle the repetitive stuff it’s still up to you to create a scalable and easy to update application.
You will need to check the following Step By Step Tutorial to learn how to create your first CI application:

4. How to Create Awesome Applications Built with CodeIgniter

4.1 Build an RSS 2.0 Feed with CodeIgniter

In this tutorial, we will learn how to build a RSS 2.0 Feed with the PHP framework CodeIgniter.

Build an RSS 2.0 Feed with CodeIgniter

4.2 Generating PDF files using CodeIgniter

In this tutorial, we will learn how to generate PDF files with CodeIgniter and the R&OS library..

4.3 Building a Shopping Cart using CodeIgniter’s Shopping Cart Class

This tutorial will cover the new “Shopping Cart” Class. The Cart Class permits items to be added to a session that stays active while a user is browsing your site. These items can be retrieved and displayed in a standard “shopping cart” format, allowing the user to update the quantity or remove items from the cart.

Building a Shopping Cart using CodeIgniter's Shopping Cart Class

4.4 CodeIgniter Clan Site- Part1 & Part2

In this series of tutorials we’ll be learning how to create a multi-gaming clan website with support for many different games, forums and a full admin system.

CodeIgniter Clan Site

4.5 Validating Web Forms with the Code Igniter

How to use the validation class included with this framework to develop a PHP program that can be used to check data submitted through some web forms.

4.6 A sample Facebook application with CodeIgniter

A sample Facebook application with CodeIgniter.

4.7 CodeIgniter and Ajax Using JQuery Tutorial

This tutorial is about creating simple CodeIgniter + database + ajax system. User will be shown a form to post a message. Then after he/she press the submit button, the system will save the message using ajax and then show the message.

CodeIgniter and Ajax Using JQuery Tutorial

4.8 Real Live Search with Pagination

In this tutorial, we will learn how to create a search page with CodeIgniter and jQuery. We’re not gonna create only a default search page using CodeIgniter framework, but also a real time search with jQuery’s support.

Real Live Search with Pagination

4.9 How to Update your Twitter Status with CodeIgniter

This article demonstrates how to update our twitter status via the ‘Twitter API’ using CodeIgniter.

How to Update your Twitter Status with CodeIgniter

4.10 Codeigniter Event Calendar

This post demonstrates how to create Codeigniter Event Calendar. When you click the date where there are events, it will take you to a page showing all the event for that day. So you can use it with javascript disabled.

Codeigniter Event Calendar update

4.11 Live search with CodeIgniter and Mootools

This article demonstrates how to create a live search application (an AJAX based application that returns search results as you type) with CodeIgniter and Mootools JSON. The application is build using JavaScript in non obtrusive ways, so it will function in just about any browser, even if they don’t support JavaScript at all.

Real Live Search

4.12 Creating a File Hosting Site with CodeIgniter

This tutorial will show you how to build a powerful web application for hosting images, using the flexibility of Codeigniter. This tutorial should teach you about the MVC coding philosophy, integral to producing serviceable applications.

Creating a File Hosting Site with CodeIgniter

5. Further Resources

Author: Noura Yehia

Noura Yehia is a Web Designer, Blogger and Creative Thinker. Founder of Noupe.com a popular blog about web design, tutorials, resources and inspiration. If you’d like to connect with her, you can follow her on Twitter or at her blog Devsnippets.