In my previous articles, I have explained about some programming concepts in CodeIgniter. But, some of the friends asking about the Basic working structure and file structure of CI. So, In this article, we are going to discussing about the Basic working structure of CodeIgniter.
Codeigniter is a fully features PHP Framework which facilitates the most of the web development features. Codeigniter is mainly developed for the PHP developers who need a full featured PHP web applications. Design integration in Codeigniter is much easier than other PHP Frameworks.
In my previous article, We have discussed about the "Installing and Configuring Codeigniter framework on localhost". In this article, We will discuss about the Basic workflow and File Structure of Codeigniter.
Codeigniter folder structure :
"system" is the main CodeIgniter folder under the installation. It contains the core Codeigniter code files. It also contains no.of sub folders. One of the main sub folder is "application". Remember "application" folder which is main development hostage for you.
"application" folder contains your HTML files, your data base configuration file and your whole control structure of Codeigniter. The rest of the system folder contains CodeIgniter core code, libraries, helpers and other files.
The "application" folder has more sub-folders inside which are responsible for keeping code files separate. Such as models, controllers, config and views.
The "application" folder contains some important files to run Codeigniter. Those files are given below with details.
1, config.php - which holds your localhost path to your Codeigniter project. It also contains some predefined rules such as permitted URLs, session expiration time, hooks enabling and some others.
2, database.php - which 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 letter. 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.
Codeigniter is a fully features PHP Framework which facilitates the most of the web development features. Codeigniter is mainly developed for the PHP developers who need a full featured PHP web applications. Design integration in Codeigniter is much easier than other PHP Frameworks.
In my previous article, We have discussed about the "Installing and Configuring Codeigniter framework on localhost". In this article, We will discuss about the Basic workflow and File Structure of Codeigniter.
Codeigniter folder structure :
"system" is the main CodeIgniter folder under the installation. It contains the core Codeigniter code files. It also contains no.of sub folders. One of the main sub folder is "application". Remember "application" folder which is main development hostage for you.
"application" folder contains your HTML files, your data base configuration file and your whole control structure of Codeigniter. The rest of the system folder contains CodeIgniter core code, libraries, helpers and other files.
The "application" folder has more sub-folders inside which are responsible for keeping code files separate. Such as models, controllers, config and views.
The "application" folder contains some important files to run Codeigniter. Those files are given below with details.
1, config.php - which holds your localhost path to your Codeigniter project. It also contains some predefined rules such as permitted URLs, session expiration time, hooks enabling and some others.
2, database.php - which 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 letter. 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.
Simply want to say your article is as astonishing related Codeigniter Developers. The clearness in your post is simply spectacular and i can assume you are an expert on this subject. Well with your permission allow me to grab your RSS feed to keep up to date with forthcoming post. Thanks a million and please keep up the gratifying work.
ReplyDeleteNice php frame work. Thanks for sharing.
ReplyDeletePHP Development Company
very nice thisi is i like it and work on it always thanks best web design company
ReplyDeleteThis comment has been removed by the author.
ReplyDelete