There are many PHP frameworks available, such as CodeIgniter, Laravel, CakePHP, Zend, Fusebox etc. Different frameworks support different architectures. For example, Laravel and CodeIgniter support MVC (Model, View, Controller) architecture.
Why We Choose CodeIgniter
CodeIgniter is a very light, well performing framework. While, it is perfect for a beginner, as we got a small learning curve, it's also perfect for large and demanding web applications. CodeIgniter is developed by EllisLab and has thorough, easy to understand documentation.
In this post I'll tell you how we start using CodeIgniter to our project.
Step 1 - Downloading CodeIgniter
Too start off you will need to download CodeIgniter from http://www.codeigniter.com/upload it to your server. Use the path C:\wamp\www
In our project we used wamp server. Extract the downloaded file and create a folder in www using your project name and copy the extracted items to the folder. As our project is a Hotel reservation system we named the project folder as "hrs".
Once you have unzip the downloaded file you can see several set of folders.
| inside application folder |
- The system folder stores all the files which make CI work.
- The config folder stores all the config files relevant to the application. Which
includes information on what libaries the application should auto load and database details. - The controllers folder stores all the controllers for the application.
- The errors folder stores all the template error pages for the application. When
an error occurs the error page is generated from one of these templates. - The helpers folder stores all the helpers which are specific to your application.
- The hooks folder is for hooks which modify the functioning of CI's core files,
hooks should only be used by advanced users of CI - The language folder stores lines of text which can be loaded through the language
library to create multilingual sites. - The libraries folder stores all the libraries which are specific to your application.
- The models folder stores all the models for the application.
- The views folder stores all the views for the application.
- The user_guide houses the user guide to CI.
- The index.php file is the bit that does all the CI magic it also lets the you change the
name of the system and application folders.
Step 2 - Configuring CodeIgniter
Getting CI up and running is rather simple. Most of it requires you to edit a few configurationfiles. You need to setup CI to point to the right base URL of the app. To do this, open up system/application/config/config.php and edit the base_url array item to point to your server and CI folder.
Database Connection.
To connect a database with your project go to,
application /config/database.php
Inside database.php you have to change the following according to your database configurations.
Step 3 - Testing CodeIgniter
To see whether your CI is running properly, Go to http://localhost/hrs/ and you
should see the following.
For more information you can visit the user guide website http://www.codeigniter.com/user_guide/.It's simple and easy to understand.
and that's all for this post see you all soon.

No comments:
Post a Comment