Course Content
Introduction to CodeIgniter 4
CodeIgniter is an Application Development Framework. CodeIgniter is a popular and powerful MVC (Model-View-Controller) framework that is used to develop web applications. It is a free and Open-source PHP framework.
0/5
MVC (Model-View-Controller)
MVC stands for Model-View-Controller. MVC is an application design model consisting of three interconnected parts. They include the model (data), the view (user interface), and the controller (processes that handle input).
0/6
Sessions
The Session class allows you to maintain a user’s "state" and track their activity while they browse your site.
0/1
URI Routing
There is a one-to-one relationship between a URL string and its corresponding controller class/method.
0/2
Working with Database
Like any other framework, we need to interact with the database very often and CodeIgniter makes this job easy for us. It provides a rich set of functionalities to interact with the database.
0/5
Spreadsheet
PhpSpreadsheet is a PHP library for reading and writing spreadsheet files. Importing Excel and CSV into MySQL help to save the user time and avoid repetitive work.
0/1
CodeIgniter 4
    About Lesson

    CodeIgniter 4 is a modern PHP framework that can be installed using various methods. This tutorial will guide you through the most common installation approaches, running your application, and ensuring your server meets the requirements.

    Prerequisites

    Before installing CodeIgniter 4, ensure your server meets the following requirements:

    • PHP Version: PHP 7.4 or newer (preferably PHP 8.0+).
    • Extensions Required: intl, mbstring, and curl.
    • Web Server: Apache, Nginx, or any web server that supports PHP.

     

    Installation Methods

    CodeIgniter 4 can be installed using three primary methods:

    1. Manual Installation
    2. Composer Installation
    3. Git Installation

     

    Composer Installation

    Composer is the recommended way to install CodeIgniter 4 as it allows you to manage dependencies and easily update your project.

    Steps for Composer Installation:

    1. Install Composer:

      • If Composer is not installed on your system, download and install it from getcomposer.org.
    2. Install CodeIgniter 4 Using Composer:

      • Open your terminal and run the following command to create a new CodeIgniter 4 project:
      • composer create-project codeigniter4/appstarter your-project-name
      • Replace your-project-name with your desired project folder name.
    3. Navigate to Your Project Directory:

      • Change into your project directory using:
      • cd your-project-name
    4. Set Up Your Application:

      • Configure your environment settings by renaming the env file to .env and adjusting settings like database credentials and base URL.
      • php spark serve
      • This command will start the server on localhost at port 8080 by default.
      • http://localhost:8080/
    5. Welcome Page:

      • You should see the default CodeIgniter 4 welcome page, confirming that the installation was successful.

     

    Troubleshooting

    • PHP Extensions Not Installed: If you encounter errors regarding missing extensions (intl, mbstring, curl), ensure they are enabled in your php.ini configuration file.
    • Port Already in Use: If port 8080 is already in use, you can specify a different port when running the server:
    • php spark serve --port=8081
       

    Note

    Before using CodeIgniter 4, make sure that your server meets the requirements.