CodeIgniter

from Wikipedia, the free encyclopedia
CodeIgniter

CodeIgniterLogo.png
Basic data

developer BCIT (originally Ellislab )
Current  version 3.1.9
(June 12, 2018)
Current preliminary version 4.0.0-alpha.2
(October 26, 2018)
operating system platform independent
programming language PHP
category Web framework
License since 3.0.0 MIT license , previously OSL 3.0
codeigniter.com

CodeIgniter is an open source web framework written in PHP . The project has been overseen by the British Columbia Institute of Technology since 2014 , having previously been developed at EllisLab.

construction

CodeIgniter is kept as lean as possible, which means that high performance is achieved and the familiarization period is short compared to other frameworks . The central component is the model view controller architecture (MVC). The use of model and view is not absolutely necessary, but is strongly recommended for reasons of clarity. CodeIgniter contains a large number of library classes and auxiliary functions that relieve the developer of standard tasks. Examples are XML-RPC , database access, input verification, sessions and file uploads. This allows web applications to be developed quickly and securely. One of CodeIgniter's great strengths is its ease of configuration . Usually you don't need much more than store the database connection and the basic url.

example

In the following example code , when http://example.com/helloworld/test is called, the “test ()” method is executed in the “helloworld” controller. The files required for this are automatically loaded by CodeIgniter and the output of the "test ()" method is sent to the client. For forwarding this clean URLs is Apache module mod_rewrite used, optional for the transfer of the controller and function names also HTTP GET arguments are used. This example makes it clear that the use of models and views is not absolutely necessary. In CodeIgniter, a model is a PHP class that provides methods for executing certain database queries. The view represents the output component and can be filled with further data by the controller according to the MVC principle.

For this example, a file named Helloworld.php is created in the application directory under / application / controllers. As of version 3.x of the framework, the file names must be case-sensitive. This means that the first letter must be capitalized, the rest, however, small. This affects all files under the following paths:

  • / application / controllers
  • / application / libraries
  • / application / models
<?php

class Helloworld extends CI_Controller
{
 function test()
 {
  echo "Hello World";
 }
}
?>

If mod_rewrite is not available, the url to load the above method is http://example.com/index.php/helloworld/test .

literature

Web links

Individual evidence

  1. License file on Github
  2. official announcement of October 6, 2014 ( memento of the original from October 17, 2014 in the Internet Archive ) Info: The archive link was automatically inserted and not yet checked. Please check the original and archive link according to the instructions and then remove this notice. on EllisLab.com @1@ 2Template: Webachiv / IABot / ellislab.com