We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dbb1147 commit 7cccbc7Copy full SHA for 7cccbc7
src/PHPValidation/Validation.php
@@ -48,6 +48,22 @@ public function rules(array $rules)
48
$this->rules = $rules;
49
}
50
51
+ /**
52
+ * Defining custom rule.
53
+ *
54
+ * Rules is an object consisting of rule/parameter
55
+ * pairs or a plain String. Can be combined with class/attribute/data rules.
56
+ * Each rule can be specified as having a depends-property to apply the rule
57
+ * only in certain conditions.
58
59
+ * @param string $name
60
+ * @param array $rules
61
+ */
62
+ public function rule($name, $rules)
63
+ {
64
+ $this->rules[$name] = $rules;
65
+ }
66
+
67
/**
68
* Add a custom validation method.
69
* It must consist of a name, a lambda function and a default string message.
0 commit comments