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

Class: HTML_QuickForm_Rule

Source Location: /pear/HTML/QuickForm/Rule.php

Class Overview




Variables

Methods


Child classes:

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

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




Tags:

access:  public

Type:   string


[ Top ]



Class Methods


method getValidationScript [line 62]

array getValidationScript( [mixed $options = null])

Returns the javascript test (the test should return true if the value is INVALID)



Tags:

return:  first element is code to setup validation, second is the check itself
access:  public


Overridden in child classes as:

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

Parameters:

mixed   $options   Options for the rule

[ Top ]

method setName [line 50]

void setName( $ruleName)

Sets the rule name



Tags:

access:  public


Parameters:

   $ruleName  

[ Top ]

method validate [line 40]

void validate( $value)

Validates a value



Tags:

abstract:  
access:  public


Overridden in child classes as:

HTML_QuickForm_Rule_Callback::validate()
Validates a value using a callback
HTML_QuickForm_Rule_Compare::validate()
HTML_QuickForm_Rule_Email::validate()
Validates an email address
HTML_QuickForm_Rule_In_Array_Keys::validate()
Tests whether input for parameter selected_key is a key in the supplied array. Useful when dealing with selects and you'll make sure that the user selects only one of the available options and not a custom one.
HTML_QuickForm_Rule_Is_Equal::validate()
Tests whether input for parameter user_input matches the supplied value.
HTML_QuickForm_Rule_Range::validate()
Validates a value using a range comparison
HTML_QuickForm_Rule_Regex::validate()
Validates a value using a regular expression
HTML_QuickForm_Rule_Required::validate()
Checks if an element is empty

Parameters:

   $value  

[ Top ]


Documentation generated on Sun, 08 Jan 2012 17:51:59 +0100 by phpDocumentor 1.4.3