🔥 CodeIgniter
Beginner
What is the MVC pattern in CodeIgniter?
Answer
CodeIgniter follows the MVC (Model-View-Controller) architectural pattern. The Model handles data access — it interacts with the database and contains data-related logic. The View contains the HTML presentation layer — what the user sees. The Controller is the glue — it receives HTTP requests, calls models for data, passes data to views, and returns responses. In CodeIgniter, the URL structure maps directly to controllers and methods: /blog/index calls the index() method of the Blog controller. The flow: Client → Router → Controller → Model → View → Controller → Response. This separation makes code organized, reusable, and testable, especially for large applications.