Suggest a Snippet Login Register
  • LOG IN:

    Not a member? JOIN NOW!
     Username                   Password
    Remember me Recover password
DevSnippets Design Community & Snippets Gallery
  • Subscribe by RSS
>
  • Webdesign
    • Design
    • HTML5
    • lists
    • Menu
    • Navigation
    • Portfolio
    • Showcase
    • Template
    • Tooltip
    • Tutorial
    • webdesign
  • Web development
    • AJAX
    • CodeIgniter
    • CSS
    • CSS3
    • Database
    • Javascript
    • jQuery
    • Mootools
    • MySQL
    • PHP
    • PHP Framework
    • plugins
    • WordPress
    • WordPress Hacks
  • Inspiration
    • Fonts
    • Icons
    • Inspiration
    • Mac
    • Mac apps
    • Photography
    • Wallpapers
  • Snippets
In {Articles} -22nd Feb- {18 Comments}

Getting Started with CodeIgniter and How to Create All Those Great Apps

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:

  • Building Applications using CodeIgniter Series: File Structure, Configuration, Helpers, Code Templates.
  • Creating First Application at CodeIgniter
  • Building a Database-Driven Application with the Code Igniter PHP Framework
  • Easy Development With CodeIgniter

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

  • - 10 Reasons Why CodeIgniter Rocks
  • - Optimizing and Scaling your CodeIgniter Application – with Benchmarks!
  • - 9 Ways to Integrate Ajax with CodeIgniter
  • - Debugging a CodeIgniter application with FirePHP
  • - 40+ CodeIgniter Framework Tutorials for PHP Application

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.

Category: Article | Leave a Comment | 18 Comments

Related Posts

18 Comments, Add Comment or Ping

  1. Taimur Aziz says:
    February 23, 2010 at 11:10 am

    I just started learning this amazing framework since 2 weeks and this article is what i was looking for .. Thanks .. Great post

  2. Andrzej says:
    February 23, 2010 at 5:18 pm

    Unfortunately, CI is written in PHP4 so using it it’s a kind of step back. Anyway, this framework is one of the best frameworks ever released. I’m currently using KohanaPHP, CI based framework, many disadvantages for now but hope it would be as good as CI is :)

    • Alex says:
      February 28, 2010 at 9:15 am

      Actually CodeIgniter is written in PHP5, however it contains backwards compatibility for PHP4. The difference between CodeIgniter and KohanaPHP is that Kohana drops all PHP4 supports and makes use of PHP5 features such as chaining, class autoload, constructors and destructors etc

      • Andrzej says:
        March 7, 2010 at 5:32 pm

        For the last time I worked with CI in 2008 and over 90% of the system is written in PHP4. What about current release? To be honest, I don’t know. Thanks for the reply. Will give CI another try. One more thing… Dropping all PHP4 support is a GOOD thing in development. Cheers!

  3. keyur patel says:
    February 24, 2010 at 3:49 am

    awesome article, CI is good, even you can try your hands on Kohana (it is based on CI, too)

  4. Tutorial Lounge says:
    February 25, 2010 at 2:52 am

    amazing post you write for framework lovers, i thinks this is just beginning for learn about that.

  5. woony says:
    March 4, 2010 at 8:38 am

    wow awesome list of tuts

  6. Joe says:
    April 10, 2010 at 12:01 am

    Nice, sounds great!

  7. Anil Kumar Panigrahi says:
    April 11, 2010 at 9:12 pm

    Very nice stuff to implementing in codeigniter, for my next application i want to implement all those posts.

    Thank you.

Trackbacks/Pingbacks

  • abcphp.com
  • Getting Started with CodeIgniter and How to Create All Those Great Apps « Freelance Web Designer from Hyderabad, India.
  • php-html.net
  • DevSnippets.com: Getting Started with CodeIgniter and How to Create All Those Great Apps | Webs Developer
  • Getting Started with CodeIgniter and How to Create All Those Great Apps | Fixzero
  • 7 Secure, Lightweight, and Easy to Use PHP Frameworks | DevSnippets
  • 7 Secure, Lightweight, and Easy to Use PHP Frameworks « qeqnes | Designing. jQuery, Ajax, PHP, MySQL and Templates
  • tutorialhou.se
  • CodeIgniter – Open source PHP web application framework | GuiDesigner

Sponsored Ads

ADVERTISE HERE

Sponsored Ads

DevSnippets Latest Articles

  • Using Illustrations in WebDesign: 30 Creative Examples
    Tags: Illustration, Inspiration, webdesign Jul/20/2010
  • Dark and Mysterious High Quality Desktop Wallpapers
    Tags: Dark, Wallpapers Jun/23/2010
  • 10+ Most Beautiful Island Photography on Earth
    Jun/16/2010
  • 35 High Definition iPad Wallpapers For A Great Experience
    Tags: Inpiration, Wallpapers Jun/09/2010
  • 30 Unique Logo Designs That Actually Say Something
    Tags: Branding, Inspiration, Logo Jun/02/2010
  • Creating 10 Most-Used Javascript Techniques Using Pure CSS Styling
    Tags: CSS, Tutorial May/31/2010
  • 40 Creative Advertisements With Unexpected Ideas
    Tags: Advertising, Inspiration May/27/2010
  • Getting Slim, Spicy, & WordPress-Ready with Top 10 jQuery Plugins
    Tags: jQuery, WordPress May/25/2010
  • Spicing Up Your Tumblr Experience: Beautiful Themes, Icons and Apps
    Tags: Templates, Tumblr May/19/2010
  • 20 NEW & FREE High Quality (X)HTML/CSS Templates
    Tags: CSS, Design, Template, Tutorial May/17/2010
More Articles →

Design Community News

  • Is It Worth Shifting To Photoshop CS5?

    SloDive
    Jul/04/2010
  • Free Wordpress Theme Vector Nature Template

    templates4all
    Jul/04/2010
  • Best jQuery plugins – June 2010

    Spider8411
    Jun/22/2010
  • Freebies: Vintage Mega Pack 10 Samples from Designious.com

    Doink
    Jun/22/2010
  • CSS3 Animations, the Power Back to CSS Part 1: Transitions

    Teylor Feliz
    Jun/22/2010
  • Create a Photo-Realistic Candle with Basic Photoshop Tools

    Frank
    Jun/22/2010
  • Credit cards and payment icon set

    icon sets
    Jun/22/2010
  • 40 Refreshing Nature Inspired Web Designs

    Brukhar
    Jun/22/2010
  • How to Create a Tumblr Theme (Code Structure)

    Dainis Graveris
    Jun/21/2010
  • The Simple Photoshop CS5 Cheat Sheet

    Frank
    Jun/21/2010
More News →

Our Friends

  • Graphic Design School

  • Designm.ag

Top ↑

Add a Snippet / Design News

© 2008-2010 DEVSNIPPETS | Made by Noura Yehia | Submit Snippet | About| Subscribe | Advertise
In partnership with (mt) Media Temple