apidoc
[ class tree: apidoc ] [ index: apidoc ] [ all elements ]

Class: HTML_QuickForm_Rule

Source Location: /HTML_QuickForm-3.2.5/QuickForm/Rule.php

Class Overview




Variables

Methods


Child classes:

HTML_QuickForm_Rule_Compare
Rule to compare two form fields
HTML_QuickForm_Rule_Regex
Validates values using regular expressions
HTML_QuickForm_Rule_Required
Required elements validation
HTML_QuickForm_Rule_Email
Email validation rule
HTML_QuickForm_Rule_Callback
Validates values using callback functions or methods
HTML_QuickForm_Rule_Range
Validates values using range comparison
RuleNumericRange

Inherited Variables

Inherited Methods


Class Details

[line 21]


[ Top ]


Class Variables

$name =

[line 32]

Name of the rule to use in validate method

This property is used in more global rules like Callback and Regex to determine which callback and which regex is to be used for validation

  • Access: public

Type:   string


[ Top ]



Method Detail

getValidationScript   [line 62]

array getValidationScript( [mixed $options = null])

Returns the javascript test (the test should return true if the value is INVALID)
  • Return: first element is code to setup validation, second is the check itself
  • Access: public

Overridden in child classes as:

HTML_QuickForm_Rule_Compare::getValidationScript()
HTML_QuickForm_Rule_Regex::getValidationScript()
HTML_QuickForm_Rule_Required::getValidationScript()
HTML_QuickForm_Rule_Email::getValidationScript()
HTML_QuickForm_Rule_Callback::getValidationScript()
HTML_QuickForm_Rule_Range::getValidationScript()
RuleNumericRange::getValidationScript()

Parameters:

mixed   $options   —  Options for the rule

[ Top ]

setName   [line 50]

void setName( $ruleName)

Sets the rule name
  • Access: public

Parameters:

   $ruleName   — 

[ Top ]

validate   [line 40]

void validate( $value)

Validates a value
  • Abstract:
  • Access: public

Overridden in child classes as:

HTML_QuickForm_Rule_Compare::validate()
HTML_QuickForm_Rule_Regex::validate()
Validates a value using a regular expression
HTML_QuickForm_Rule_Required::validate()
Checks if an element is empty
HTML_QuickForm_Rule_Email::validate()
Validates an email address
HTML_QuickForm_Rule_Callback::validate()
Validates a value using a callback
HTML_QuickForm_Rule_Range::validate()
Validates a value using a range comparison
RuleNumericRange::validate()

Parameters:

   $value   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:16:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.