Part-1: Learn Codeigniter PHP framework: Basic working Structure

Author: Zeeshan Rasool  |  Mar 4, 2010 Codeigniter, Web Development

Codeigniter is very light and fully featured framework which gives you every thing which you want in web development.
It is a powerful PHP framework with very small footprint. It is built for PHP coders who need a simple and elegant toolkit to create a featured web applications.It allows you to design the exact web apps you need.

I discussed codeigniter installation in my previous post and now we will talk about its file structure.

“system” is the main codeIgniter folder under the installation. The system folder contains the core codeigniter code. The system folder contains a number of other folders, one of which is called application.
Remember “application” folder which is main development hostage for you.

This folder is contains your HTML files, your data base configuration file and your whole control structure.The rest of the system folder contains CodeIgniter core code, libraries, helpers and other files.


The application folder has more folders inside which  are responsible for keeping code files separate. Such as models , controllers, config and views.

Now i move to models and other folders. You can see config folder inside application folder which contains different files. Some of important files are given below in detail

1- config.php which holds your localhost path to your project. it also contains some predefined rules such as permitted URLs, session expiration time, hooks enabling and some others.

2- database.php contains the database configurations. you need to give host name password and user name for connecting to db.

Next folder is controller which holds all of your controllers. Controller is basic part of codeigniter.

Controller is a php class file and inherits from a base codeigniter Controller class using the extends keyword.
Codeigniter controller names should start with an uppercase lette. Inside the constructor, the parent::Controller() statement is needed to make sure that the current class inherits functionality of the Controller class. Developers can call functions internal to a controller using $this->function() but codeigniter controllers cannot call functions inside another controller.

See Next

Recommended WordPress Themes Stores



If you enjoyed this post, please consider leaving a comment below or subscribing to the RSS feed to have future articles delivered to your feed reader. You can also follow us on Facebook or Twitter @99Points

This awesome post has been created by 99Points editor's team. You can follow our updates on Twitter and facebook, OR drop an email at 99points.info@gmail.com



Email Subscriber!

Be the first to know about new updates


Author of 99Points
Zeeshan Rasool is an experienced PHP Web Developer and founder at 99Points. Expert in Codeigniter (MVC), WordPress, JSON, jQuery & HTML5
 LinkedIn Profile  About.me


Advertisement




Friends


Categories


Popular post