What is New In CodeIgniter 4.x

What is New In CodeIgniter 4.x?

As we all know CodeIgniter is a PHP lightweight MVC framework.

It provides us fast, flexible, and secure techniques to develop PHP based applications.

The Codeigniter 4.x alpha and beta are released but the available version is not recommended for production use.

The flexibility of Codeigniter is maintained as usual along with the advancement of compatibility with PHP 7.

 

Core Features of CodeIgniter

  • CI is an MVC framework with a small footprint.
  • Codeigniter gives exceptional performance.
  • This is an MVC  framework with zero configuration.
  • No command-line configuration setup or dependencies installation to start(Optional).
  • CI is not restricted to any naming convention or coding rules.
  • No need to learn about advanced concepts like PEAR.
  • You do not need to learn template engine rendering. 
  • Simple, Clear and easy to understand documentation.

Features of Codeigniter 4.x

  1. The earlier versions of Codeigniter are based on PHP 5.6 or lower but the Codeigniter 4 will be featured with PHP 7.2 functionality and compatibility.
  2. It required the *intl* extension of PHP installed on the server.
  3. If we would like to use CURLRequest, we will need lib curl installed.
  4. Supported databases are:
    1. MySQL (5.1+) via the MySQLi driver
    2. PostgreSQL via the Postgre driver
    3. SqLite3 via the SQLite3 driver
  5. CodeIgniter 4 can also be used with command-line programs. As per the latest trend, most of the frameworks provide CLI usability and library. Since Codeigniter 4.x the framework will also be providing CLI interfaces for different purposes.
  6. The following PHP extensions should be enabled on your server: 
    1. Php-json
    2. Php-mbstring
    3. Php-mysqlnd
    4. Php-xml
  7. If you want to use CURLRequest in your CI application, you will need to install libcurl.
  8. The framework now provides for a public folder, intended as the document root for your app
  9. Hooks in Codeigniter are a great feature in is maintained and improved as well.

How to install Codeigniter 4?

Codeigniter 4 can be installed using many methods

  • In Manual Installation, you need to download the latest release from official site and can place it in your www directory after extracting it.
  • If you want to use the composer tool you need to install the composer first and then you can install using command line. Composer will also help you to add third-party plugins in your project in the future. You can download and install the composer from this link: https://getcomposer.org/
  • You can also clone the git repository of CodeIgniter.

Directory Structure for Codeigniter 4.x

A newly installed application has six directories:

  1. application
  2. system
  3. public
  4. writable
  5. tests
  6. Docs

Application Structure

  1. The framework still has app and system folders, with the same interpretation as before
  2. The framework now provides for a public folder, intended as the document root for your app
  3. There is also a writable folder, to hold cache data, logs, and session data
  4. The application folder looks very similar to that for CI3, with some name changes, and some subfolders moved to the writable folder
  5. There is no longer a nested application/core folder

The application directory i.e. app is the source code of your application. All the stuff done by you will remain here. The default structure of the app directory is as :

/app

        /Config         Stores the configuration files

        /Controllers    Controllers determine the program flow

        /Database       Stores the database migrations and seeds files

        /Filters        Stores filter classes that can run before and after a controller

        /Helpers        Helpers store collections of standalone functions

        /Language       Multiple language support reads the language strings from here

        /Libraries      Useful classes that don’t fit in another category

        /Models         Models the database and business logic.

        /ThirdParty     ThirdParty libraries that can be used in application

        /Views          Views make up the HTML that is displayed to the client.

The above concepts will help you when you will doing any application on code igniter or you will be in CodeIgniter interview.

Dhananjay

Dhananjay

I’m Dhananjay — a free-spirit with a passion for technologies and blogging.

View all posts by Dhananjay →

2 thoughts on “What is New In CodeIgniter 4.x?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.