Zend Framework : Validator for Positive Integer Value

/**
     * Validates if $data given is integer and greater than a number $min
     * @param type $data
     * @param type $min
     * @return type      */
    public function validatePositiveInteger($data, $min=0) {
        $validator = new Zend_Validate_Int();
        $validatorPositive = new Zend_Validate_GreaterThan($min);
        if (($validator->isValid($data)) && ($validatorPositive->isValid($data))) {            return TRUE;
        } else {
            return FALSE;
        }
    }
Processing your request, Please wait....

No Responses to “Zend Framework : Validator for Positive Integer Value”

Comments (Your Comments)

Leave a Reply

You must be logged in to post a comment.