void registerRule(
string
$ruleName, string
$type, string
$data1, [string
$data2 = null])
|
|
Registers a new validation rule
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.
Parameters:
Returns a singleton of HTML_QuickForm_RuleRegistry
Usually, only one RuleRegistry object is needed, this is the reason why it is recommended to use this method to get the validation object.