After this lesson you can explain where CodeIgniter fits in a PHP application and describe the bookshop you will build. You need ordinary PHP knowledge: variables, arrays, functions, classes and namespaces. If those are unfamiliar, start with the PHP course. Framework vocabulary becomes much easier when you can already follow a function call.
A framework gives requests a home
A small PHP script can read a request, query a database and print HTML in one file. That approach is useful for learning. As features accumulate, however, the same file can become responsible for database access, permission checks, page markup and error messages. Changing one responsibility may unexpectedly affect another. A framework supplies conventions and reusable request handling so that you can separate these decisions.
CodeIgniter is a PHP web framework. This course teaches CodeIgniter 4.7.6, as of 2026-11, installed and checked with PHP 8.4.24 and Composer 2.10.2. CodeIgniter's official User Guide describes its application structure, HTTP facilities and database components. These are documented capabilities. Whether its conventions suit your team is a design decision rather than a universal ranking of frameworks.
Our fictional business is Paper Lantern Bookshop. It has two invented catalogue titles, no real customers and no payment system. You will list books, view one book, practise validated changes and expose a small JSON reading interface. The application remains a local learning project until authentication, authorization and hosting have been reviewed. Nothing here describes mrhimanshu.com's backend or claims anything about its visitors.
Follow one request
Imagine a browser requesting the catalogue. A route chooses a controller action. The action asks a model for books. The model uses a database connection. A view renders the resulting array into HTML, escaping titles before inserting them into the document. Finally, the application returns an HTTP response. These parts cooperate; they are not separate servers.
GET /books
-> explicit route
-> Books controller, index method
-> BookModel and SQLite
-> books/index view
-> HTML responseThis diagram is an explanation, not terminal output. Later lessons will implement every named application component. Keeping that distinction matters: a design sketch tells you what should happen, while a captured response tells you what actually happened during verification.
The initials MVC mean model, view and controller. A model is a useful boundary around stored application data. A view describes presentation. A controller coordinates a request and response. MVC does not require placing every rule into one giant model, nor does it mean a controller must always return HTML. The API lessons return JSON while reusing the catalogue model.
Compare at the level of responsibilities
Plain PHP lets you choose every convention yourself. CodeIgniter supplies routing, request objects, validation, views and database tools. Other PHP frameworks also address these responsibilities, with different defaults and ecosystems. Choosing between them should involve the application's needs, the team's experience, package compatibility and deployment constraints. This course makes no performance comparison and promises no development-time saving.
Do not translate a CodeIgniter 3 tutorial mechanically into version 4. Namespaces, project layout and APIs need version-specific documentation. Even within version 4, confirm the installed release before copying a feature from a newer guide. Learning to locate the official documentation is part of learning a framework.
The source we use is the official CodeIgniter 4 User Guide. Its application-structure page was fetched while preparing this course. It explains the directories; the bookshop's division of responsibilities is our worked example, not an official required architecture.
Define a small finish line
A beginner project needs observable acceptance conditions. A visitor can see a list and a detail page. An unknown identifier produces a missing-resource response. A blank title cannot be saved. A title containing markup appears as text. A request without permission must not become a catalogue write merely because somebody knows its URL. These conditions are more useful than saying the project should be “professional”.
We deliberately leave purchasing, stock reservation and personal customer records outside the project. Each introduces rules that would distract from the request lifecycle. After the final lesson you should be able to identify those missing responsibilities, rather than mistake a catalogue demonstration for a complete shop.
Common mistakes
Treating the framework as a substitute for PHP makes errors harder to understand. Trace the called method and the value it returns. Another mistake is copying a directory named system into your application and editing framework internals. Composer owns the installed framework; your application code belongs in its own directories. Finally, do not assume a working page proves safe access controls. A successful response only proves that one request worked.
Exercise
Describe the responsibilities involved when a reader opens one book. Identify where a missing book should be detected and where its title should be escaped. Do this before writing code so that folder names do not replace reasoning.
Show an answer
The route selects a detail action. The controller asks the model for the identifier, detects an absent result and chooses a missing-page response. For a present result, it passes the record to a view. The view escapes the title for its HTML context. The database stores the original title rather than a pre-escaped presentation string.
Next lesson · Related: explicit routes · Related: security boundaries
Key points
- The course verifies CodeIgniter 4.7.6 as of 2026-11.
- Routes, controllers, models and views divide responsibilities.
- A local catalogue demonstration still needs an access-control review before exposure.