Codeigniter 4 – Views with Examples

Codeigniter 4 - Views with Examples What is a View? - A View is a file that contains the HTML and PHP code for displaying data to the user. - Views are stored in the app/Views directory. Creating a View - Create a new file in the app/Views directory (e.g. user_view.php). - Add HTML and...

Codeigniter 4 – URL’s with Examples

Codeigniter 4 - URL's with Examples URL Basics - URLs in CodeIgniter 4 are handled by the URI class. - The URI class provides methods for working with URLs. URL Structure - CodeIgniter 4 URLs follow the following structure: `(link unavailable) - controller is the name of the controller class. - method is the name...

Codeigniter 4 – Controllers with examples

Codeigniter 4 - Controllers with examples What is a Controller? - A Controller is a class that acts as an intermediary between the Model and View. - It receives input from the user, interacts with the Model to perform business logic, and passes data to the View for rendering. Creating a Controller - Create a...

Codeigniter 4 – MVC Design Pattern with examples

Codeigniter 4 - MVC Design Pattern with examples Model - Purpose: Represents the data and business logic of the application - Responsibilities: - Interact with the database - Perform calculations and data processing - Validate data - Example: app/Models/UserModel.php <?php namespace App\Models; use CodeIgniter\Model; class UserModel extends Model { protected $table = 'users'; protected $primaryKey...

Codeigniter 4 – Folder Structure

Application Structure or Folder Structure in Codeigniter 4 Folder Structure in CodeIgniter 4 CodeIgniter 4 has a specific folder structure that helps to organize your application files and folders. Here is an overview of the folder structure: App Folder - Purpose: Contains all application-specific files and folders - Subfolders: - Config: Configuration files - Controllers:...

Server Requirements to Run Codeigniter 4

Server Requirements to Run Codeigniter 4 - PHP 7.2 or higher: CodeIgniter 4 requires PHP 7.2 or higher to run. This ensures that you have the latest security patches and features. - MySQL 5.6 or higher: CodeIgniter 4 supports MySQL 5.6 or higher, as well as other databases like PostgreSQL and SQLite. - Apache 2.4...

Introduction of Codeigniter 4

Introduction of Codeigniter 4 Overview of CodeIgniter 4 CodeIgniter 4 is a powerful and lightweight PHP framework that enables developers to build robust and scalable web applications quickly and efficiently. It is an open-source framework that provides a rich set of features and tools to simplify the development process. History of CodeIgniter 4 CodeIgniter was...

Autoloading in php with syntax and examples

Autoloading in php with syntax and examples Autoloading is a mechanism in PHP that allows you to automatically include classes, interfaces, and traits without explicitly using require or include statements. Syntax: spl_autoload_register(function ($class) { // code to include the class file }); Example: spl_autoload_register(function ($class) { include 'classes/' . $class . '.php'; }); $obj =...

Magic methods in php with syntax and examples

Magic methods in php with syntax and examples Magic methods are special methods in PHP classes that are automatically called when certain events occur. They start with double underscores (__) and are also known as "magic functions". List of Magic Methods: 1. __construct() - Called when an object is created 2. __destruct() - Called when...

CRUD Operations in PHP PDO with Exception Management

CRUD Operations in PHP PDO with Exception Management with examples CRUD stands for Create, Read, Update, and Delete. These are the basic operations used to interact with a database. Create (Insert): - Inserts new data into the database Syntax: INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...); Example: $sql = "INSERT INTO users...

Shopping cart0
There are no products in the cart!
Continue shopping
0