May I ask you a few questions about thinkphp development?

Source: Internet
Author: User
Ask the following questions about the development of thinkphp
Small just contact MVC development model, with thinkphp development, the user submitted the form, the verification of the form on the C-level or in the M layer ah?
------Solution--------------------
Thinkphp built-in model verification

If you feel inconvenient, you can accept the parameter in C for manual verification.
------Solution--------------------
Encapsulation in the M-layer is better, before the storage of required fields and data legality are checked once
For example, the user name password must be filled and the number of digits greater than 6, mobile phone and mailbox format, etc.
The operation returns true successfully, the failure returns the error string, and then the C-layer $this->error () directly prints the error, or the Ajax returns, depending on the situation
The interface of M layer can be called by multiple pages of C layer
  • 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.