validator.php
Test for inline code highlighter.
function add($name,$advice,$func)
{
$this->ValidateRules[$name] = new ValidateRule($name,$advice,$func);
}
function addValidateRuleObject($ValidateRule)
{
$this->ValidateRules[$ValidateRule->name] = $ValidateRule;
}
function get($name)
{
return $this->ValidateRules[$name];
}
};
class ValidateRule
{
var $name;
var $advice;
var $func;
function ValidateRule($name,$advice,$func)
{
$this->name = $name;
$this->advice = $advice;
$this->func = $func;
}
function getAdvice()
{
return $this->advice;
}
function test()
{
$args = func_get_args();
return call_user_func_array($this->func,$args);
}
};