Questions tagged [codeigniter]

CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites 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 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 use in 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 3.1.10 was released January 16, 2019.

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 18k star 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: 3.1.10 (Release Date: January 16, 2019)


Top Tips For Codeigniter

One of the most common asked questions in Codeigniter on Stack Overflow is when I view my page I get error 404 "Page Not Found". There are a couple of solutions you should look at before asking the question.

  1. Solution 1: Check the first letter of class name and filename of controller and models is the Uppercase example: Welcome.php

  2. Solution 2: If base_url() returns unexpected results, it's because you have not set a $config['base_url'] value.

  3. 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 URL

  4. Solution 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


Online resources

68242 questions
6
votes
1 answer

how to give multiple colors in the same cell in a full calendar?

I want to create an event calendar. There are two halls in upstairs and downstairs. and functions should be categorized into am or pm. All together there are 4 different colors for upstairs am, upstairs pm, downstairs am and downstairs pm. I want…
Ishani Pathinayake
  • 177
  • 1
  • 1
  • 14
6
votes
3 answers

create parent and its child tree in codeigniter

I am working in codeigniter.I want to display parent agent and its child agent under the parent agent. My parent agent data display like this Array ( [0] => stdClass Object ( [id] => 1 [Introducer_code] => 0 [Designation]…
Nisarg Bhavsar
  • 926
  • 2
  • 14
  • 36
6
votes
1 answer

CodeIgniter is_unique Error Message in Language File

When using CodeIgniter I like to set my error messages in application/language/english/form_validation_lang.php which works fine for every error message but does not seem to work for the is_unique message as it gives me the standard message of "The…
James Walker
  • 775
  • 5
  • 20
6
votes
5 answers

explode csv file on delimiter (;) and delimiter(,)?

when I explode csv file on delimiter (;) the explode successfully in some excel program and failed in others also when I explode csv file on delimiter (,) the explode successfully in some excel program and failed in others How can I do explode…
6
votes
1 answer

How to use the down() method in CodeIgniter's migration?

I read the CodeIgniter's documentation about the migration class. I am able to perform the migration but how can I use the down() function in the migration? Here's the sample from the documentation defined('BASEPATH') OR exit('No direct script…
Jerielle
  • 5,994
  • 27
  • 75
  • 146
6
votes
6 answers

Error: You must use the "set" method to update an entry fix?

I am using codeigniter as my PHP framework, and I keep getting this error when I submit my from to post to my database. You must use the "set" method to update an entry I am not exactly sure what that means, from the other posts I have looked at,…
ddrossi93
  • 366
  • 2
  • 6
  • 17
6
votes
4 answers

How can I set class="active" to navigation menu in codeigniter?

I just start up to be a web developer. Now I create a dynamic website for the first time. I don't know how to set class="active" to the navigation menu. Here is my menu code:
  • Phearum Chheang
    • 89
    • 1
    • 2
    • 10
  • 6
    votes
    2 answers

    Debug Mode for CodeIgniter?

    Does CodeIgniter provide a Debug Mode, for example, when accessing an Invalid URL? Ruby on Rails does show debugging Messages when a incorrect URL has been given, and the controller is unable to resolve it using the routes map. How would I enable…
    user350814
    6
    votes
    2 answers

    Paypal Payflow pro library

    I already have an express checkout integrated with my Codeigniter application. Now I want to integrate seamless paypal where I collect the CC information and pass it to Paypal (via backend) and once everything is approved, my application shows that…
    Obaid
    • 4,170
    • 8
    • 38
    • 42
    6
    votes
    4 answers

    Get post values when the key is unknown in CodeIgniter

    CodeIgniter allows access to POSTed data via: $this->input->post('input_name'); where 'input_name' is the name of a form field. This works well for a static form where each input name in known ahead of time. In my case, I am loading a collection of…
    GloryFish
    • 12,027
    • 16
    • 50
    • 43
    6
    votes
    5 answers

    Codeigniter's URL Rewriting

    I'm using the following htaccess script so that I can hide index.php from the URI. RewriteEngine on RewriteCond $1 !^(index\.php|resources|assets|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$…
    A.N.M. Saiful Islam
    • 1,950
    • 5
    • 25
    • 32
    6
    votes
    5 answers

    Codeigniter: how to get data between today and last 15 days from database

    my database table looks like below | id | user_name | address | contact | date | |----|-----------|---------|---------|----------| | 1 | john | NY | 12345 |2015-4-20 | | 2 | Mart | NY | 54345 |2015-4-05 | | 3 |…
    Sujan Shrestha
    • 612
    • 3
    • 11
    • 29
    6
    votes
    1 answer

    PHP Save array in database and miss data

    I need to save in database category like "a & b" but the model save in database just "a" miss the blank space and the &. This is the array: $data = array('avenvu' => $_POST['avenvu'], 'brand' => $_POST['brand'], …
    davidev
    • 304
    • 8
    • 20
    6
    votes
    4 answers

    CodeIgniter and layouts?

    What CodeIgniter library can provide this funcionality?? http://media.railscasts.com/videos/008_content_for.mov It seems so simple on rails but I just cant find a simple way to achieve this on codeigniter.. please help.. I hate having to insert my…
    nacho10f
    • 5,266
    • 5
    • 35
    • 70
    6
    votes
    4 answers

    Message: Configured database connection is persistent. Aborting

    Codeigniter 2 to 3 version after upgrading, I get this error.. Why would that be? An uncaught Exception was encountered Type: Exception Message: Configured database connection is persistent. Aborting. Filename:…
    Demir Aksa
    • 93
    • 1
    • 1
    • 5
    1 2 3
    99
    100