I, more or less, “get” MVC when it comes to generic explanations but I’m having trouble applying it to a script I’d actually make.
Okay, picture a browser-based virtual dog game. You know, HTML, jpeg images, CSS, and perhaps a little JavaScript. Each dog would have its own profile page. If it’s your dog, then you could change its details. So, its page would have forms on it, such as a form to change its name. You’d submit the form and some code in the site would process it (check for errors, update the database, etc.)
Would the HTML for the form be considered part of the view or part of the controller?
What about the code that actually processes the code, is that the controller?
Finally, the code that actually updates the database, that’s the model, right?
Please note: What if the form automatically had the dog’s name already in it. For example, if your dog’s name was “Fido” the form to change its name would automatically have “Fido” already typed in it. Is this part of the view? Or is it part of the model because the site had to look in the database to know that’s your dog’s name?
I’m confident I’ll wrap my head around all this eventually ?