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

Class: HTML_QuickForm_Rule

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

Class Overview


Abstract base class for QuickForm validation rules


Author(s):

Version:

  • Release: 3.2.14

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
Checks that the length of value is within range

Inherited Variables

Inherited Methods


Class Details

[line 34]
Abstract base class for QuickForm validation rules


[ Top ]


Class Variables

$name =

[line 45]

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 77]

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
  • Abstract:
  • 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()

Parameters:

mixed   $options   —  Options for the rule

[ Top ]

setName   [line 64]

void setName( string $ruleName)

Sets the rule name
  • Access: public

Parameters:

string   $ruleName   —  rule name

[ Top ]

validate   [line 53]

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

Parameters:

   $value   — 

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:59:48 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.