The master of TP framework answers my doubts

WBOY
Release: 2016-07-06 13:54:00
Original
1127 people have browsed it

tp is a framework of MVC pattern, but why do I rarely use M when developing projects or watching many tp teaching videos? I myself have been writing code in V and C. When should I write in M? Thanks for the answer

Reply content:

tp is a framework of MVC pattern, but why do I rarely use M when developing projects or watching many tp teaching videos? I myself have been writing code in V and C. When should I write in M? Thanks for the answer

In the conventional MVC framework, the M layer should be responsible for most of the data operations. If the business logic is used, the EVENT layer under TP should be better used. At this time, the business logic will be placed in the event layer, and then the model The layer is responsible for more atomic data operations, improving code reuse and development efficiency

Because those tutorials put all curd in the C layer, only used the automatic verification, automatic completion and other functions of the M layer, and did not extract the data operations to the Model

Related labels:
php
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!