From 6bdbf6e9867cb6ea6987a47344d89357a8a783ef Mon Sep 17 00:00:00 2001 From: denis Date: Tue, 1 Oct 2013 09:22:06 +0300 Subject: [PATCH] Update Ruleset.php --- classes/PHPixie/Validate/Ruleset.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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); + } + +}