Home
+91 99674 50288
info@appmonks.net
×

What is CodeIgniter ?

CodeIgniter is an open source framework for creating full-featured PHP-based web sites and applications. It is based on the MVC (Model-View-Controller) architecture and is compatible with standard shared hosting accounts, various PHP versions (including PHP4 and PHP5) and configurations. Plus, you don't have to use a command line. URLs are mapped to a particular function within a controller by means of routing. CodeIgniter also supports scaffolding which represents an automated way of generating views based on the models. Although scaffolding is designed for simple prototyping, CodeIgniter takes it a step further by requiring a keyword in the URL in order to access it at all. This modern MVC framework renders the creating of PHP applications much easier. A large portion of the work, such as loading libraries, getting data from the model, rendering the view, etc., is done inside the controller. CodeIgniter provides classes for FTP, email, file uploading, XMLRPC, zip encoding. You are not required to give names to you database tables or to name your models after your tables.


CodeIgniter has a very small footprint - it is just about 2 MB, including the documentation which you can delete later. Plus, it works with all servers and web hosting accounts that provide PHP version 4.3.2 or newer. CodeIgniter requires a database for most web applications. Current supported ones are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.


Models, Views, Controllers - CodeIgniter's MVC architecture

CodeIgniter is based on the MVC architecture whose main point is that the views have to be separated from the back end of a given application. The back and the front end, on the other hand, are connected using controllers. The separation between the front and the back end of a web application makes the code readable and easier to understand.


Models

Models have to do with connecting to a database and performing Create, Read, Update and Delete operations. Most often, there is a model for each table in the database. It is named tablename_model.php. Models and controllers contain an uppercased constructor, which often bears the same name as the page itself. The models have their own functions which can be called as soon as you create a specific instance of the given model.


Controllers


The controllers connect the back end and the front end. In the example above, the Form_model functions performed the INSERT and SELECT statements. The controller will call these functions to output what it needs to display to a view. All database-related functions in CodeIgniter are set and called using a model. The front end is displayed and managed by the view. The controller’s structure resembles that of the model and its name is in lowercase.


Views


The views display what you in fact see. You can set up a view in many ways. You can have only one view to represent different pages based on the information that the controllers pass to it, or instead have an entirely different view for each web page

Mail
casino