ZF Framework Checker using the example _php tutorial

Source: Internet
Author: User
This article mainly introduces the use of the ZF Framework verifier using the example (custom validator and validator chain), the need for friends can refer to the following

The code is as follows: _messages[] = "The value you entered is not a common multiple of 3 and 5!" "; Terminates the program return false; }//return true return true; }//Define error method for interface public function getmessages () {return $this-_messages;}//Define extract error message (not available) public function geterrors () { }}//out-of-class definition detection common multiple method function Check_num ($num) {//Instantiate validator class $Validate = new Zend_validate ();//Add Validator feature class, add custom Validator function class, form validator chain $ Validate-Addvalidator (New Zend_validate_int ()), Addvalidator (New Gongbeinum ()); Check parameters if (! $Validate, IsValid ($num)) {//If error loop error message and output foreach ($Validate, Getmessages () as $value) {echo $val Web. "
"; return false; }}}//Specify the value of $NUM1 = ' 15 ';//Run Calibration Method Check_num ($num 1);? >

http://www.bkjia.com/PHPjc/741457.html www.bkjia.com true http://www.bkjia.com/PHPjc/741457.html techarticle This article mainly introduces the use of the ZF Framework checker using the example (custom validator and validator chain), the need for friends can refer to the following code:? Phprequire_once (zend/loader.php);

  • 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.