Part-1: Learn Codeigniter PHP framework: Basic working Structure
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.
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.