thinkphp automatic verification, automatic completion, field ... ____php

Source: Internet
Author: User
Tags aliases

1, the use of automatic verification methods must use the Create () method to be effective;

2, if the primary key is not incremented, the function can not pass the Create () method inside whether the primary key to judge is the update operation or insert operation. This time you need to manually specify

Create ($_post,1) "Insert Data"

Create ($_post,2) "Update Data"

3 , automatic mapping is to De Yin the database character to an alias, and you can use aliases in the form.
Protected $_map = Array (
' Name ' => ' username ',
' Pass ' => ' password ',
);

Note that the front is the alias, the following is the database field, do not write back, another mapping after the automatic verification, automatically completed or to write database fields, do not write aliases

Protected $_validate=array (
Array (' name ', ' Require ', ' username required '),
Array (' Password ', ' Require ', ' password required '),

);

After using automatic mapping, automatically verifies that the fields here are also red. To use the fields of the database, you will not be able to use the fields of the form if you use the

4 , automatic completion is not performed if an automatic validation error occurs.

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.