Tp framework answers questions from younger siblings

Source: Internet
Author: User
Tp is a MVC framework, but why do I rarely use M when I am in project development or watch a lot of tp teaching videos? I have been writing code in V and C all the time. I want to write it in M. thank you for your answers. tp is a MVC framework. But why do I rarely use M in my project development or watch many tp teaching videos? what should I write code in V and C in M? thank you for your answers.

Reply content:

Tp is a MVC framework, but why do I rarely use M when I am in project development or watch a lot of tp teaching videos? I have been writing code in V and C all the time. I want to write it in M. thank you for your answers.

In the conventional MVC framework, the M layer should be responsible for most data operations. if the business logic is the case, the EVENT layer under the TP should be better utilized, the business logic will be placed on the event layer, and the model layer will be responsible for more atomic data operations to improve code reuse rate and development efficiency.

Because all the tutorials place curd on the C layer, they only use features such as automatic verification and automatic completion of the M layer, and do not extract data operations from the Model.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.