php framework - Why do lightweight frameworks like slim not strictly distinguish between model layers?
PHP中文网
PHP中文网 2017-05-16 17:05:35
0
1
544

Why do lightweight frameworks like slim not strictly differentiate between model layers?

PHP中文网
PHP中文网

认证0级讲师

reply all(1)
大家讲道理

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. 🎜
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template