Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Do put stuff related to authorization/access control in the controller. </p> <p>Models are all about your data. Validation, Relationships, CRUD, Business Logic </p> <p>Views are about showing your data. Display and getting input only.</p> <p>Controllers are about controlling what data goes from your model to your view (and which view) and from your view to your model. Controllers can also exist without models.</p> <p>I like to think of the controller as a security guard/receptionist who directs you the customer(request) to the appropriate counter where you ask a teller (view) a question. The teller (view) then goes and gets the answer from a manager (model), who you never see. You the request then go back to the security guard/receptionist (controller) and wait until you are directed to go another teller (view) who tells you the answer the manager (model) told them in response to the other teller's (view) question. </p> <p>Likewise if you want to tell the teller (view) something then largely the same thing happens except the second teller will tell you whether the manager accepted your information. It is also possible that the security guard/receptionist (controller) may have told you to take a hike since you were not authorized to tell the manager that information.</p> <p>So to extend the metaphor, in my stereotyped and unrealistic world, tellers (views) are pretty but empty-headed and often believe anything you tell them, security guard/receptionists are minimally polite but are not very knowledgeable but they know where people should and shouldn't go and managers are really ugly and mean but know everything and can tell what is true and what isn't.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload