In fact, dividing levels is a logical problem. Many novice users use frameworks from the beginning and are spoiled by frameworks. Frameworks can do almost everything. All they have learned is to write code under a certain framework. , and out of the frame, only confusion remains. Even if a heavy framework like domestic Thinkphp provides the Model layer, there are still very few people using it. Why? Because using the Model layer requires you to divide the logic yourself and write code yourself, which is painful for them, so almost all the people I have seen operate the database in the Controller Directly M('table')->insert($data) and so on. The utilization rate of the Model layer is extremely low. Thinkphp这样的重型框架,他提供了Model层,用的人仍然很少,为什么?因为用Model层还需要自己划分逻辑,仍少不了自己写代码,这对他们来说是痛苦的,所以我见过的几乎所有的人操作数据库都是在Controller里直接M('table')->insert($data)等。Model层的利用率极低。 而对于非小白用户,Model层无法就是个封装了某个表的数据库操作类而已,随手就创建了,何须框架来多此一举,浪费性能? 只要心中就有mvc,一切都有层次。 而且,随着composerFor non-novice users, the Model layer cannot be just a database operation class that encapsulates a certain table and is created casually. Why do we need a framework to do this and waste performance?
As long as you have mvc in your heart, everything has levels. 🎜Moreover, with the emergence of composer, PHP development has gradually become modularized, instead of the previous framework. Now more and more people write code that uses modules directly instead of the entire framework. 🎜
In fact, dividing levels is a logical problem. Many novice users use frameworks from the beginning and are spoiled by frameworks. Frameworks can do almost everything. All they have learned is to write code under a certain framework. , and out of the frame, only confusion remains.
As long as you haveEven if a heavy framework like domestic
Thinkphp
provides theModel
layer, there are still very few people using it. Why? Because using theModel
layer requires you to divide the logic yourself and write code yourself, which is painful for them, so almost all the people I have seen operate the database in theController
DirectlyM('table')->insert($data)
and so on. The utilization rate of theModel
layer is extremely low.Thinkphp
这样的重型框架,他提供了Model
层,用的人仍然很少,为什么?因为用Model
层还需要自己划分逻辑,仍少不了自己写代码,这对他们来说是痛苦的,所以我见过的几乎所有的人操作数据库都是在Controller
里直接M('table')->insert($data)
等。Model
层的利用率极低。而对于非小白用户,Model层无法就是个封装了某个表的数据库操作类而已,随手就创建了,何须框架来多此一举,浪费性能?
只要心中就有
mvc
,一切都有层次。而且,随着
composer
For non-novice users, the Model layer cannot be just a database operation class that encapsulates a certain table and is created casually. Why do we need a framework to do this and waste performance?mvc
in your heart, everything has levels. 🎜Moreover, with the emergence ofcomposer
, PHP development has gradually become modularized, instead of the previous framework. Now more and more people write code that uses modules directly instead of the entire framework. 🎜