What are the New Features In CodeIgniter 4

CodeIgniter is popular because of its light-weighted MVC framework. It provides us a fast, flexible and secure environment to develop web applications in PHP.

CodeIgniter 4 is the latest version for the CodeIgniter framework and now it’s available to use in production level. There is a lot of expectation with this new version. so developers were waiting for this version very eagerly.

CodeIgniter 4 supports or you can say Compatible with PHP 7 (the latest version of PHP ).

First, we should know about the core feature of CodeIgniter. Because of which CodeIgniter is famous among developers.

Core Features of CodeIgniter
  • Codeigniter is a framework with zero configuration.
  • You can use CodeIgniter without a command-line configuration or setup. and also you can say CodeIgniter does not have any command line dependencies.
  • CodeIgniter is not restricted to any naming convention or coding rules.
  • For working with CodeIgniter you need not learn about an advanced concept like PEAR.
  • And the most important it has a Simple, Clear and easy to understand documentation. 
Features of CodeIgniter 4
  • CodeIgniter’s earliest version was based on PHP 5.6 or lower but CodeIgniter 4 is Featured with PHP 7.2 functionality and compatibility.
  • In CI4 if you want to use CURL Request then you need lib curl installed.
  • CodeIgniter supported Databases are –
      • MySQL (5.1+)
      • PostgreSQL
      • SqLite3
  • CI 4 also supports command-line programs. as per the latest trends, maximum frameworks provide CLI usability and library. So now CodeIgniter 4 has also adopted this feature and now you can use Command line in the latest version of CI.
  • CI 4 now provides a public folder, intended as the document root for your app.
  • CI 4 has now owned server like laravel and you can start it using PHP spark serve.
How to install CodeIgniter 4

CodeIgniter 4 can be installed using three ways –

Manual Installation –

You can download the latest release of CI 4 from its official site and can place it in your server root directory after extracting it.

Using Composer-

You can install it using Composer. For installation using Composer, you have to run a command
composer create-project codeigniter4/appstarter project-root
but for this first, you need to download and install composer so you can download composer from this link
https://getcomposer.org/

Using GIT Repository –

You can also get CodeIgniter file from a git repository of CI 4 you can use the below link to get it and after download, you can put it in your root directory.

https://github.com/bcit-ci/CodeIgniter

 

Directory Structure for CodeIgniter 4
  1. Application
  2. System
  3. Public
  4. Writable
  5. Tests
  6. Docs
Application Structure -
  1. CI 4 has still app and system folders with the same functions as before.
  2. Now in CI 4, there is a public folder, intended as the root document of your app.
  3. In CI 4, there is also a folder name writable to cache data, logs and session data.
  4. Other all the folder of CI 4 looks very similar to that for CI3 with some name changes and some subfolders moved to a writable folder.
  5. Now there is no longer any nested folder application/core

In the CI4 folder structure app is the source folder for your application where you have to write all the codes. So below are the default structure of app folder-

/app

    • /config – It stores the configuration files
    • /Controllers – as the name says that this folder contains the controller of your app. The controller determines the program flow.
    • /Database – this folder stores database migrations and seeds
    • /Filters – It stores filter classes than can run before and after a controller
    • /Helpers – It stores collections of stand-alone functions.
    • /Language – In this folder multiple language supports and language string files are there.
    • /Libraries – This is a useful class that does not fit in another category.
    • /Models – Models the database and business logic of your project.
    • /ThirdParty – this folder contain third-party libraries used in the application.
    • /Views – this folder content HTML that is displayed to the client.

So above were the new features which CodeIgniter 4 provides. You wanted to know the Difference between CodeIgniter 3 (Earliest Version ) and CodeIgniter 4 ( Latest version ) then you can click on the below link.

https://technologyrevision.com/technology-comparison/codeigniter-3-vs-codeigniter-4/

Thanks for reading my blog, if you have any queries related to the blog then you can ask in the comment section. also, you can give any suggestions on mail@technologyrevision.com.

Leave a Reply

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