void HTML_QuickForm::registerRule (
string $ruleName
, string $type
, string $data1
, string $data2
= null
)
Registers a new validation rule
$ruleName
Name of validation rule
$type
Either: 'regex'
or 'callback'
('function'
is also kept for backward compatibility). If registering a subclass of HTML_QuickForm_Rule you can pass anything here, preferrably NULL or empty string.
$data1
Name of function, regular expression, classname of HTML_QuickForm_Rule subclass or an instance of such class.
The callback function needs to return true
or
false
, determining if the rule is passed or not.
$data2
Object parent of above function, name of the file containing the subclass of HTML_QuickForm_Rule.
throws no exceptions thrown
since 1.0
This function can not be called statically.