| // +----------------------------------------------------------------------+ // // $Id: Rule.php,v 1.1 2006/09/24 17:04:53 jamiesensei Exp $ class HTML_QuickForm_Rule { /** * 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 * * @var string * @access public */ var $name; /** * Validates a value * * @access public * @abstract */ function validate($value) { return true; } /** * Sets the rule name * * @access public */ function setName($ruleName) { $this->name = $ruleName; } /** * Returns the javascript test (the test should return true if the value is INVALID) * * @param mixed Options for the rule * @access public * @return array first element is code to setup validation, second is the check itself */ function getValidationScript($options = null) { return array('', ''); } } ?>