Monday, April 4, 2022

MVC (Model View Controller)

 CodeIgniter Overview MVC

Model - View - Controller
Databases - Web pages - Functions

View

  • A page that we're seeing can be a view.
  • In charge of presenting the HTML code. (what we see like header or any webpage).

Model

  • Say if that page (mentioned in view) has a button and if we click on that button, that act could mean communicating with a model and also controller.
  • Model is a folder in the framework that contains all the classes (communicate with the database). We'll have functions in those classes.
  • The model separates these classes from view classes and controller classes.

Controller

  • The 'middle-man'. Controls both View and Model.
  • Say if we want to look at a page (View), but at the same time, we also want to get some information (Model), and then transfer it back to View. So, the Controller is going to control that.

Basically, separation of our code into these 3 different categories.

No comments:

Post a Comment

Komen atau sebarang pertanyaan di sini :)

WordPress #3 | How to Change Website URL

Hi. Today we're gonna look at how to change your website URL in case you messed up. In this case, yes, I messed up. That is why this pos...