Home > Zend_Validate > Standard Validators of Zend Framework

Standard Validators of Zend Framework

This class validates $value is alphabet or number.
Following is about the constructer.

    /**
     * Sets default option values for this instance
     *
     * @param  boolean $allowWhiteSpace
     * @return void
     */
    public function __construct($allowWhiteSpace = false)

Following is about the error messages.

Error Message Key Initial Error Message
notAlnum '%value%' has not only alphabetic and digit characters
stringEmpty '%value%' is an empty string
This class validates $value is alphabet.
Following is about the constructer.

    /**
     * Sets default option values for this instance
     *
     * @param  boolean $allowWhiteSpace
     * @return void
     */
    public function __construct($allowWhiteSpace = false)

Following is about the error messages.

Error Message Key Initial Error Message
notAlpha '%value%' has not only alphabetic characters
stringEmpty '%value%' is an empty string
This class validates $values is barcode format.
Following is about the constructer.
('upc' or 'ean13' can be used as the parameter $barcodeType)

    /**
     * Generates the standard validator object
     *
     * @param  string $barcodeType - Barcode validator to use
     * @return void
     * @throws Zend_Validate_Exception
     */
    public function __construct($barcodeType)

Following is about the error messages(UPC-A).

Error Message Key Initial Error Message
invalid '%value%' is an invalid UPC-A barcode
invalidLength '%value%' is an invalid UPC-A barcode

Following is about the error messages(EAN-13).

Error Message Key Initial Error Message
invalid '%value%' is an invalid EAN-13 barcode
invalidLength '%value%' should be 13 characters
This class validates $value is between $min and $max.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  mixed   $min
     * @param  mixed   $max
     * @param  boolean $inclusive
     * @return void
     */
    public function __construct($min, $max, $inclusive = true)

Following is about the error messages.

Error Message Key Initial Error Message
notBetween '%value%' is not between '%min%' and '%max%', inclusively
notBetweenStrict '%value%' is not strictly between '%min%' and '%max%'
This class validates $value follows Luhn algorithm (mod-10 checksum) credit card numbers.
This class has no constructer.
Following is about the error messages.

Error Message Key Initial Error Message
ccnumLength '%value%' must contain between 13 and 19 digits
ccnumChecksum Luhn algorithm (mod-10 checksum) failed on '%value%'
This class validates $value is a valid date of the specified format(default YYYY-MM-DD).
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  string             $format OPTIONAL
     * @param  string|Zend_Locale $locale OPTIONAL
     * @return void
     */
    public function __construct($format = null, $locale = null)

Following is about the error messages.

Error Message Key Initial Error Message
dateNotYYYY-MM-DD '%value%' is not of the format YYYY-MM-DD
dateInvalid '%value%' does not appear to be a valid date
dateFalseFormat '%value%' does not fit given date format
This class validates $value only contains digit characters.
This class has no constructer.
Following is about the error messages.

Error Message Key Initial Error Message
notDigits '%value%' contains not only digit characters
stringEmpty '%value%' is an empty string
This class validates $value is a valid email address.
Following is about the constructer.

    /**
     * Instantiates hostname validator for local use
     *
     * You can pass a bitfield to determine what types of hostnames are allowed.
     * These bitfields are defined by the ALLOW_* constants in
 Zend_Validate_Hostname
     * The default is to allow DNS hostnames only
     *
     * @param integer                $allow             OPTIONAL
     * @param bool                   $validateMx        OPTIONAL
     * @param Zend_Validate_Hostname $hostnameValidator OPTIONAL
     * @return void
     */
    public function __construct($allow = Zend_Validate_Hostname::ALLOW_DNS,
        $validateMx = false, Zend_Validate_Hostname $hostnameValidator = null)

Following is about the error messages.

Error Message Key Initial Error Message
emailAddressInvalid '%value%' is not a valid email address in the basic format local-part@hostname
emailAddressInvalidHostname '%hostname%' is not a valid hostname for email address '%value%'
emailAddressInvalidMxRecord '%hostname%' does not appear to have a valid MX record for the email address '%value%'
emailAddressDotAtom '%localPart%' not matched against dot-atom format
emailAddressQuotedString '%localPart%' not matched against quoted-string format
emailAddressInvalidLocalPart '%localPart%' is not a valid local part for email address '%value%'
This class validates $value is a floating-point value.
This class has no constructer.
Following is about the error messages.

Error Message Key Initial Error Message
notFloat '%value%' does not appear to be a float
This class validates $value is greater than $min.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  mixed $min
     * @return void
     */
    public function __construct($min)

Following is about the error messages.

Error Message Key Initial Error Message
notGreaterThan '%value%' is not greater than '%min%'
This class validates $value contains only hexadecimal digit characters.
This class has no constructer.
Following is about the error messages.

Error Message Key Initial Error Message
notHex '%value%' has not only hexadecimal digit characters
This class validates $value is a valid host name.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param integer          $allow       OPTIONAL Set what types of hostname
 to allow (default ALLOW_DNS)
     * @param boolean          $validateIdn OPTIONAL Set whether IDN domains are
 validated (default true)
     * @param boolean          $validateTld OPTIONAL Set whether the TLD element
 of a hostname is validated (default true)
     * @param Zend_Validate_Ip $ipValidator OPTIONAL
     * @return void
     * @see http://www.iana.org/cctld/specifications-policies-cctlds-01apr02.htm
  Technical Specifications for ccTLDs
     */
    public function __construct($allow = self::ALLOW_DNS, $validateIdn = true,
         $validateTld = true, Zend_Validate_Ip $ipValidator = null)

Following is about the error messages.

Error Message Key Initial Error Message
hostnameIpAddressNotAllowed '%value%' appears to be an IP address, but IP addresses are not allowed
hostnameUnknownTld '%value%' appears to be a DNS hostname but cannot match TLD against known list
hostnameDashCharacter '%value%' appears to be a DNS hostname but contains a dash (-) in an invalid position
hostnameInvalidHostnameSchema '%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'
hostnameUndecipherableTld '%value%' appears to be a DNS hostname but cannot extract TLD part
hostnameInvalidHostname '%value%' does not match the expected structure for a DNS hostname
hostnameInvalidLocalName '%value%' does not appear to be a valid local network name
hostnameLocalNameNotAllowed '%value%' appears to be a local network name but local network names are not allowed
This class validates $value is same as $token.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  string $token
     * @return void
     */
    public function __construct($token = null)

Following is about the error messages.

Error Message Key Initial Error Message
notSame Tokens do not match
missingToken No token was provided to match against
This class validates $value is contained in array $haystack.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  array   $haystack
     * @param  boolean $strict
     * @return void
     */
    public function __construct(array $haystack, $strict = false)

Following is about the error messages.

Error Message Key Initial Error Message
notInArray '%value%' was not found in the haystack
This class validates $value is a valid integer.
This class has no constructer.
Following is about the error messages.

Error Message Key Initial Error Message
notInt '%value%' does not appear to be an integer
This class validates $value is a valid ip address.
This class has no constructer.
Following is about the error messages.

Error Message Key Initial Error Message
notIpAddress '%value%' does not appear to be a valid IP address
This class validates $value is less than $max.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  mixed $max
     * @return void
     */
    public function __construct($max)

Following is about the error messages.

Error Message Key Initial Error Message
notLessThan '%value%' is not less than '%max%'
This class validates $value is not empty.
This class has no constructer.
Following is about the error messages.

Error Message Key Initial Error Message
isEmpty Value is empty, but a non-empty value is required
This class validates $value matches against a regular expression pattern.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  string $pattern
     * @return void
     */
    public function __construct($pattern)

Following is about the error messages.

Error Message Key Initial Error Message
regexNotMatch '%value%' does not match against pattern '%pattern%'
This class validates the string length of $value is between $min and $max.
Following is about the constructer.

    /**
     * Sets validator options
     *
     * @param  integer $min
     * @param  integer $max
     * @return void
     */
    public function __construct($min = 0, $max = null)

Following is about the error messages.

Error Message Key Initial Error Message
stringLengthTooShort '%value%' is less than %min% characters long
stringLengthTooLong '%value%' is greater than %max% characters long
I have not check it... You can download English and Japanese files from here.

notAlnum;'%value%' has not only alphabetic and digit characters
stringEmpty;'%value%' is an empty string
notAlpha;'%value%' has not only alphabetic characters
invalid;'%value%' is an invalid UPC-A barcode
invalidLength;'%value%' is an invalid UPC-A barcode
notBetween;'%value%' is not between '%min%' and '%max%', inclusively
notBetweenStrict;'%value%' is not strictly between '%min%' and '%max%'
ccnumLength;'%value%' must contain between 13 and 19 digits
ccnumChecksum;Luhn algorithm (mod-10 checksum) failed on '%value%'
dateNotYYYY-MM-DD;'%value%' is not of the format YYYY-MM-DD
dateInvalid;'%value%' does not appear to be a valid date
dateFalseFormat;'%value%' does not fit given date format
notDigits;'%value%' contains not only digit characters
emailAddressInvalid;'%value%' is not a valid email address in the basic format local-part@hostname
emailAddressInvalidHostname;'%hostname%' is not a valid hostname for email address '%value%'
emailAddressInvalidMxRecord ;'%hostname%' does not appear to have a valid MX record for the email address '%value%'
emailAddressDotAtom;'%localPart%' not matched against dot-atom format
emailAddressQuotedString;'%localPart%' not matched against quoted-string format
emailAddressInvalidLocalPart;'%localPart%' is not a valid local part for email address '%value%'
notFloat;'%value%' does not appear to be a float
notGreaterThan;'%value%' is not greater than '%min%'
notHex;'%value%' has not only hexadecimal digit characters
hostnameIpAddressNotAllowed;'%value%' appears to be an IP address, but IP addresses are not allowed
hostnameUnknownTld;'%value%' appears to be a DNS hostname but cannot match TLD against known list
hostnameDashCharacter;'%value%' appears to be a DNS hostname but contains a dash (-) in an invalid position
hostnameInvalidHostnameSchema;'%value%' appears to be a DNS hostname but cannot match against hostname schema for TLD '%tld%'
hostnameUndecipherableTld;'%value%' appears to be a DNS hostname but cannot extract TLD part
hostnameInvalidHostname;'%value%' does not match the expected structure for a DNS hostname
hostnameInvalidLocalName;'%value%' does not appear to be a valid local network name
hostnameLocalNameNotAllowed;'%value%' appears to be a local network name but local network names are not allowed
notSame;Tokens do not match
missingToken;No token was provided to match against
notInArray;'%value%' was not found in the haystack
notInt;'%value%' does not appear to be an integer
notIpAddress;'%value%' does not appear to be a valid IP address
notLessThan;'%value%' is not less than '%max%'
isEmpty;Value is empty, but a non-empty value is required
regexNotMatch;'%value%' does not match against pattern '%pattern%'
stringLengthTooShort;'%value%' is less than %min% characters long
stringLengthTooLong;'%value%' is greater than %max% characters long

Comments:0

Comment Form
Remember personal info

Trackbacks:0

Trackback URL for this entry
http://www.oplabo.com/article/12/trackback
Listed below are links to weblogs that reference
Standard Validators of Zend Framework from Open Programming Laboratory

Home > Zend_Validate > Standard Validators of Zend Framework

Japanese
Search
Feeds

Return to page top