diff --git a/classes/PHPixie/Validate/Ruleset.php b/classes/PHPixie/Validate/Ruleset.php index 5bf2c2f..7d14556 100644 --- a/classes/PHPixie/Validate/Ruleset.php +++ b/classes/PHPixie/Validate/Ruleset.php @@ -237,4 +237,15 @@ public function rule_same_as($val,$target_field, $validator) { return $val == $validator->get($target_field); } -} \ No newline at end of file + + /** + * Allow add custom rule with lambda functions + * @param string $val + * @param function $fun + * @return mixed + */ + protected function rule_custom($val, $fun) { + return $fun($val); + } + +}