In order to use a custom rule in your form, you need to register it first. For regular expressions, one can directly use the 'regex' type rule in addRule(), this is faster than registering the rule.
Functions and methods can be registered. Use the 'function' type. When registering a method, specify the class name as second parameter.
You can also register an HTML_QuickForm_Rule subclass with its own validate() method.
Tags:
access:
public
Parameters:
string
$ruleName
Name of validation rule
string
$type
Either: 'regex', 'function' or null
string
$data1
Name of function, regular expression or HTML_QuickForm_Rule object class name
string
$data2
Object parent of above function or HTML_QuickForm_Rule file path