| Fully Qualified Name: | CodeIgniter\Validation\ValidationInterface |
Expected behavior of a validator
| Name | Description | Defined By |
|---|---|---|
| check() | Check; runs the validation process, returning true or false determining whether or not validation was successful. | ValidationInterface |
| getError() | Returns the error for a specified $field (or empty string if not set). | ValidationInterface |
| getErrors() | Returns the array of errors that were encountered during a run() call. The array should be in the following format: | ValidationInterface |
| hasRule() | Checks to see if the rule for key $field has been set or not. | ValidationInterface |
| reset() | Resets the class to a blank slate. Should be called whenever you need to process more than one array. | ValidationInterface |
| run() | Runs the validation process, returning true/false determining whether or not validation was successful. | ValidationInterface |
| setError() | Sets the error for a specific field. Used by custom validation methods. | ValidationInterface |
| setRules() | Stores the rules that should be used to validate the items. | ValidationInterface |
| withRequest() | Takes a Request object and grabs the input data to use from its array values. | ValidationInterface |
Check; runs the validation process, returning true or false determining whether or not validation was successful.
| Parameter Name | Type | Description |
|---|---|---|
| $value | mixed | Value |
| $rule | string | Rule. |
| $errors | string[] | Errors. |
Returns: bool True if valid, else false.
Returns the error for a specified $field (or empty string if not set).
| Parameter Name | Type | Description |
|---|---|---|
| $field | string |
Returns: string
Returns the array of errors that were encountered during a run() call. The array should be in the following format:
[
'field1' => 'error message',
'field2' => 'error message',
]
Returns: array
Checks to see if the rule for key $field has been set or not.
| Parameter Name | Type | Description |
|---|---|---|
| $field | string |
Returns: bool
Resets the class to a blank slate. Should be called whenever you need to process more than one array.
Returns: \CodeIgniter\Validation\ValidationInterface
Runs the validation process, returning true/false determining whether or not validation was successful.
| Parameter Name | Type | Description |
|---|---|---|
| $data | array | The |
| $group | string | The |
Returns: bool
Sets the error for a specific field. Used by custom validation methods.
| Parameter Name | Type | Description |
|---|---|---|
| $alias | string | |
| $error | string |
Returns: \CodeIgniter\Validation\ValidationInterface
Stores the rules that should be used to validate the items.
| Parameter Name | Type | Description |
|---|---|---|
| $rules | array | |
| $messages | array |
Returns: \CodeIgniter\Validation\ValidationInterface
Takes a Request object and grabs the input data to use from its array values.
| Parameter Name | Type | Description |
|---|---|---|
| $request | \CodeIgniter\HTTP\RequestInterface |
Returns: \CodeIgniter\Validation\ValidationInterface