Ok guys,
I’m about to begin working on a sister site to my current site, however I want to start getting into the habit of moving away from procedural programming. Eventually, I’ll have to redo a lot of my code on my other site to make things cleaner.
Anyway, one problem I’m having is fully grasping the concept of MVC. From what I understand thus far:
Model = Data (or business logic)
View = Representation of Data (how the data will be formated and how the user will see it)
Controller = The connection point of what data to use and how it should be viewed.
From what I understand, all these are in the file structure as folders. I assume afterwards that if you wanted to create the index.php file, that you’d create a new file outside the MVC folders called index, and call the MVC class files respectively creating class objects where needed.
I assume also that the same concept would apply for say a newsupdates.php page where the database request would reside in the model, the html output and representation would reside in the view, and the controller would say get that data and use that view. If I’m also correct, you could essentially make another page called newsarchive.php and reference the same model used in newsupdate.php with the news archive view right?