Explain MVC architecture in CodeIgniter

MVC stands for model, view and controller. It is a technique to organize our project's code in certain manner. Model M represent the model part and in this part we keep all the database related code and interactions. We keep database schema / structure here. We perform database related operation by using model classes. In CodeIgniter we extent all the model class with CI_Model class (It is CodeIgniter's build-in class). Ideally we should create one model class for one table, which makes are code more cleaner and easy to maintain. Controllers interact with model classes to retrieve and save data into database. We should create model class in application/models/ folder. Controller It contains complete project's business logic. Controllers also works as a mediator between models (database classes) and templates (HTML UIs). Controllers are bind with URLs, so whenever a user hits a URL based on URL and views mapping, appropriate view function and classed gets called. Every controller in controller must be extended with CI_Controller controller class. We need to create controllers in application/controllers folder. Views These are HTML files which used to create user interfaces. Sometimes we have embedded PHP in it to create dynamic web pages. We can pass variables and objects to CodeIgniter view to load dynamic content. Through controllers we render views. We can execute condition and loop statements also in CodeIgniter views. We need to create views in application/views folder. By adopting this architecture, we can organize our codebase in a structured and modular way, which improves readability and simplifies future updates or changes. This not only enhances maintainability but also reduces development time and associated costs, making the system more efficient and scalable in the long run.