Validation conditions and validation opportunities

Source: Internet
Author: User
Validation criteria:

The fourth element of the rule, which is verified when the condition is met, provides a total of three preset values:

Presence: equivalent to Isset () authentication:self::exists_validate, 0 (default = 0);

Value is not NULL verified: equivalent to!emtpy (): Self::value_validate, 2;

Must verify: equivalent: if (true), self::must_validate, 1;

Validation time (Validate custom business logic):

Operational level ( business logic level )

The sixth element of a rule.

Three opportunities are available:

Whether the array has a primary key value to judge

Self::model_insert or 1 new data when validating, $model->add () method validation

Self::model_update or 2 edit data when validating, $model->save (), there are primary key values in the array

Self::model_both or 3 is verified in all cases (default).

Validation conditions and validation opportunities

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.