I have read the PHP MVC pattern part 2 that is nice by the way. If a directly use the controller to call the view, is that right? there are some instances that you don’t need to use the model. for Example, showing the addnewproduct page/section.
Short answer: It depends.
Long answer: MVC on the web was a label that was applied retroactively to what people were already doing. People had database abstraction layers, template engines and “page scripts” which tied the other two together. “MVC” is a term commonly used in desktop applications and and at a cursory glace, has some similar components: The model, handling business logic, the view handling display and the controller handling user input.
In the traditional sense, what people generally refer to as “MVC” in regards to PHP scripts is not MVC in the traditional sense. I’ve written about this in detail here: https://r.je/views-are-not-templates.html
But realistically, there are multiple different patterns people refer to as “MVC”.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.