@@ -79,21 +79,40 @@ Array
79
79
80
80
## Predefined Rules
81
81
82
- There are some basic rules implemented with the component.
83
-
84
- Every rule options:
85
-
86
- * ** fields** - String[ ]
87
-
88
- List of keys in array to apply rule on.
89
-
90
- * ** message** - String
91
-
92
- Error message for failing validation field.
93
-
94
- ### Required Rule
95
-
96
- Rule checks if key exists in array and is not null.
82
+ There are some basic rules implemented with the component:
83
+
84
+ * ** Callback(closure $closure)**
85
+ - Takes Closure as parameter. ** $key** and ** $data** will be sent to Closure.
86
+
87
+ * ** EqualsTo(mixed $value)**
88
+ - Check if value is equal to Rule $value parameter.
89
+
90
+ * ** EqualsToKey(string $key)**
91
+ - Check if value is equal to other key value.
92
+
93
+ * ** Expression(string $regex)**
94
+ - Takes regex as parameter.
95
+
96
+ * ** Filter(int $filterRule, array $filterOptions)**
97
+ - Rule uses `` filter_var `` function for validating the value.
98
+ - Takes PHP filter constants to apply as first param:
99
+ * FILTER_VALIDATE_EMAIL
100
+ * FILTER_VALIDATE_FLOAT
101
+ * FILTER_VALIDATE_INT
102
+ * FILTER_VALIDATE_IP
103
+ * FILTER_VALIDATE_MAC
104
+ * FILTER_VALIDATE_REGEXP
105
+ * FILTER_VALIDATE_URL
106
+ - Takes `` filter_var `` options array as second param.
107
+ - Refer to `` filter_var `` function documentation for more [ information] ( http://php.net/manual/en/function.filter-var.php )
108
+
109
+ * ** Length(int $length)**
110
+ * ** LengthRange(int $min, int $max)**
111
+ * ** MaxLength(int $max)**
112
+ * ** MinLength(int $min)**
113
+
114
+ * ** Required**
115
+ - Check if the field exists and not empty
97
116
98
117
### Expression Rule
99
118
0 commit comments