Skip to content
This repository has been archived by the owner on Mar 23, 2022. It is now read-only.
/ mvc Public archive

The basics for an MVC application

License

Notifications You must be signed in to change notification settings

jasny/mvc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jasny's MVC basics for PHP

Includes a router, a controller base class and a class for loading views.

What is MVC?

The Model View Controller pattern splits the user interface interaction into three distinct roles. Each with it's own responsibility.

View: "Hey, controller, the user just told me he wants item 4 deleted." Controller: "Hmm, having checked his credentials, he is allowed to do that... Hey, model, I want you to get item 4 and do whatever you do to delete it." Model: "Item 4... got it. It's deleted. Back to you, Controller." Controller: "Here, I'll collect the new set of data. Back to you, view." View: "Cool, I'll show the new set to the user now."