Like the Zend Framework, CodeIgniter uses the front-end controller pattern. All HTTP requests are received by index.php, sent to the proper processing routines through a routing system, passed through a security system (which shields the application's controllers from malicious input), then finally handed to a controller. The controller loads the model, processes the request, and sends the result to the view system.
CodeIgniter helpers, libraries, extensions
A class extension is -- as its name implies -- simply the PHP mechanism for extending the instance variables and methods of an existing class to provide specialized capabilities. Finally, CodeIgniter hooks let you alter the behavior of the framework itself, without having to hack into the code. You define a hook by specifying a hooking point. For example, the pre_system hooking point attaches the hook early in the process of system execution, while the post_system hooking point lets you inject behavior after the Web page has been rendered. You then associate class and method, as well as the file path to the class and method that you want invoked. When the application's execution hits the hooking point, CodeIgniter will dynamically load and execute your code.
|Test Center Scorecard|
CodeIgniter supports the MVC pattern loosely. You can, for example, employ only controller and view components if no back-end database (and, therefore, no model) is required. CodeIgniter uses the active record database pattern for database access, and the framework's database access methods are straightforward and easily mastered. For example, a simple get() method looks like this:
$query = $this->db->get('theTable');
This retrieves all the data from table theTable. You can modify this in a fashion mimicking an SQL WHERE clause where the second argument is an associative array that specifies the fields participating in the WHERE conditional:
$query = $this->db->get_where('mytable', array('id'=>$id, $limit, $offset);
CodeIgniter even provides methods that let you assemble more complex queries by chaining together comparison operations joined by AND and OR logical operators.