Kayla Knight has written a great overview of the Model-View-Controller (MVC) Coding Structure over at OnExtraPixel. The article covers the basic idea behind the structure and how you could create your own bespoke MVC.
My own view of MVC is:
- Controllers receive the requests, ask models to do all the heavy lifting and directs the views
- Models receive, validate, and process all data. Each model should represent a thing e.g. an account, user etc. Sometimes things can have multiple tables. The model should deal with the session and validation work too. This makes the code much more reusable and more representative of business rules being uniformly enforced.
- Views get pushed out to the users