Home >Backend Development >PHP Tutorial >Thoughts on the php mvc development model_PHP tutorial
What is the purpose of using the mvc development model? ?
MVC is a design pattern that enforces separation of application input, processing, and output. Applications using MVC are divided into three core components: model, view, and controller. They each handle their own tasks.
Do we need to strictly distinguish the three-layer mode of MVC? The cross-border use of m and c is more conducive to rapid development.
In the framework I use, m and c can be used across boundaries and are not strictly distinguished. Sometimes I really want to deal with m directly in c, because business data processing is rare, maybe only once. In this way, writing a function in m,
and then calling it with c becomes complicated, which is contrary to the PHP rapid development concept.
What do we need?
1. View separation
2. Code reuse
3. Development efficiency
So I feel that in mvc mode development, it is not necessarily mandatory. Distinguish between m and c. Data that needs to be reused is put into m, and data that does not need to be reused can be thrown directly into c. What do you think? ?