CodeIgniter is an Application Development Framework - a toolkit - for people who build websites using PHP. Created by EllisLab & fostered by BCIT it is now a project of the CodeIgniter Foundation. The framework implements a modified version of the Model-View-Controller design pattern. Use this tag for questions about CodeIgniter classes, methods, functions, syntax, and use. There are two major versions: 3.x and 4.x, addressing different system requirements
CodeIgniter is an open-source php web application framework created by EllisLab Inc, and it is now a project of British Columbia Institute of Technology. The framework implements a modified version of the Model-View-Controller design pattern. It is praised for its performance and the quality of its documentation. It's currently licensed under the MIT License, although the previous version was released under the Open Software License ("OSL") v. 3.0.
CodeIgniter is an open-source rapid development web application framework for building dynamic websites with PHP. "Its goal is to enable [developers] to develop projects much faster than writing code from scratch by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries." The first public version of CodeIgniter was released on February 28, 2006, and the latest stable version 4.2.10 was released on November 5, 2022
CodeIgniter is loosely based on the popular Model-View-Controller development pattern. While view and controller classes are a necessary part of development under CodeIgniter, models are optional.
With more than 18.2k stars on Codeigniter's repository, it's also among the most starred PHP Framework on Github.com
These are generally regarded as pros of the framework:
- Nearly zero configuration & No restrictive coding rules
- Small footprint
- Performance
- Easy to learn
- Great documentation
- No restrictive coding rules
These are generally regarded as cons of the framework:
- No built-in ORM
- No built-in templating
- Doesn't utilize namespaces
- Doesn't utilize PHP's auto-loading feature
- Application code is tightly-coupled with the framework
CodeIgniter Versions
Current Stable Version: 4.2.10 (Release Date: November 5, 2022)
Top Tips For Codeigniter
One of the most commonly asked questions in Codeigniter on Stack Overflow is when I view my page and get the error 404 "Page Not Found". It would help if you looked at a couple of solutions before asking the question.
Solution 1: Check the first letter of the class name and filename of the controller and models in the Uppercase example: Welcome.php
Solution 2: If
base_url()
returns unexpected results, it's because you have not set a$config['base_url']
value.Solution 3: If you have not configured your CodeIgniter application/config/config.php file to remove
$config['index_page'] = '';
then you will need to include the index.php in your URLSolution 4: After all settings, you need to load the form URL etc.. in autoload.php
$autoload['helper'] = array('url', 'file', 'form', 'security');
http://www.example.com/index.php/site
Note you will need a .htaccess file when you are removing index.php .htaccess for Codeigniter 2 & 3
Frequently asked questions
- How should I choose an authentication library for CodeIgniter?
- How do I write a .htaccess file to make CodeIgniters URL routing work?
- Codeigniter: Get Instance
- CodeIgniter: How to get Controller, Action, URL information
- CodeIgniter: Create new helper?
- Enabling $_GET in codeigniter
- CodeIgniter - accessing $config variable in view
Online resources
- Official documentation
- Codeigniter 4v User Guide
- Codeigniter 3v User Guide
- Codeigniter 2v User Guide
- Official Wiki
- CodeIgniter Wikipedia Article
- Source Code on GitHub
- Codeigniter forums
- CodeIgniter 4 announcement
- Codeigniter
.htaccess
examples Github - Download latest version 4.2.10
- Setting up HMVC in codeigniter
- DataMapper ORM for Codeigniter 2