Simple Codeigniter 4 CRUD Application in Hindi (Form Validation and Insert a Record) - Part 3

Опубликовано: 12 Март 2026
на канале: PHP TECH LIFE
10,870
109

Please subscribe to my channel and hit the notification bell, so you don’t miss any of my new videos.
➡️ http://bit.ly/PHPTechLife

Topic:-
In this Codeigniter 4 video series, we'll create CRUD application in Codeigniter 4 framework. I've written all the steps which you can follow so you want get confused.

Video Topic:
Create and Validate a Form
Insert a Record in DB
User session in Codeigniter 4

Here are the steps we will follow during the development of this application.

==============================================
Simple Codeigniter 4 CRUD Application in Hindi
==============================================

Server Requirements:
------------------------------------
PHP version 7.2 or newer is required, with the intl extension and mbstring extension installed.

Currently supported databases are:
------------------------------------
MySQL (5.1+) via the MySQLi driver
PostgreSQL via the Postgre driver
SQLite3 via the SQLite3 driver

https://codeigniter4.github.io/usergu...

-------------------------------------
Installation
-------------------------------------
0) You need to install Composer first, if you already installed you can skip this step.
1) Open your working folder, if you are using xammpp you need to open htdocs directory.
2) Now open CMD and go to htdocs folder, and run the composer command given below.
composer create-project codeigniter4/appstarter ci4_crud

Note: make sure intl and mbstring extension installed.

3) To access the project in browser, we need top open ci4_crud in CMD and run the command given below.
php spark serve
If, you see a welcome screen it means, you have successfully installed Codeigniter 4 project.

4) Create a database called ci4_latest with a table called "books", that we will use in our CRUD application
id, title, isbn_no, author, created_at
5) Create a controller called "Book" inside the following directory.
app\controllers\Book.php

6) Now inside "Book" controller, we'll create a method called "index". This method will load our
first landing page, which will hold the listing of books in a tabular form.

7) Open routes.php and create a "Get" route for books listing.

8) We will use bootstrap 4 for our project, you can download bootstrap files from my github account.
https://github.com/mohitsingh2006/ci4...

9) Create a folder name "assets" inside public directory and paste the "css" and "js" folder there.

10) Now, we will create a view called "list.php" inside sub folder called "books" in views
directory, directory given below.
app\views\books\list.php

11) Let's load our "list.php" view in "index" method of Book Controller class and create some basic
structure for our CRUD APP in our "list.php" view.

############# Create
12) Now we'll create function in "Book Controller" that will load our create form
    Location: app\Controllers\Book.php

13) Now in routes.php file we need to define a get route.

14) Let's create a view called "create.php" in the location given below. And load this view in in
    create method of "Book Controller"
    Location: Views/books/create.php

15) Lets create our create form inside "create.php" view.    

16) In "create" method of "Book" Controller, we'll validate our form, and then save values in DB.

17) Before save we need to create a model which will interact with database and save values in DB,
    we will create a model called "BookModel.php" in following location.
    App\Models\BookModel.php
    Note: Make sure define allowed fields in model
    protected $allowedFields = ['title','isbn_no','author'];

19) Now after save we will redirect user with a flash session message
   
    Winner Winner Chicken Dinner, you have successfully completed create part.

#codeigniter
#codeignitertutorial
#ajax_crud

🔶 Youtube Equipments:-
1) 2020 Apple Mac Mini ♦︎ https://amzn.to/3yuisa9
2) WD Elements USB 3.0 1TB Portable External Hard Drive ♦︎ https://amzn.to/3Ro8Ru6
3) JBL Headphone ♦︎ https://amzn.to/3AKz7Jg
4) Dell E2420HS 24 Inch (60.9 cm) FHD (1920 x 1080) LED Backlit LCD IPS Monitor https://amzn.to/3RojihB
5) boAt Rockerz 450 ♦︎ https://amzn.to/3PdNR7M

🔶 Microphone
1) Boya BYM1 Omnidirectional Lavalier Condenser Microphone ♦︎ https://amzn.to/3ySYk32
2) Maono AU-903 Portable USB Microphone ♦︎ https://amzn.to/3c28WDO

🔶 Keyboard
1) Logitech K120 Wired Keyboard for Windows ♦︎ https://amzn.to/3nV2bWQ
2) HP K500F Gaming Keyboard ♦︎ https://amzn.to/3yuVlMT
3) Apple Magic Keyboard with Numeric Keypad ♦︎ https://amzn.to/3yvuakW