CanValidateForm
Table of Contents
- validateForm() : Result
- Validates form data from the client
Methods
validateForm()
Validates form data from the client
public
validateForm(array<string|int, Field> $fields[, array<string|int, mixed> $data = null ]) : Result
Parameters
- $fields : array<string|int, Field>
-
Array of fields with the validation rules
- $data : array<string|int, mixed> = null
-
Input for the validation, defaults to getPost() + getFiles() when null. getGet() or getPost() can be used here as parameters, an empty array is validated as it is Rules other than required() are skipped for empty values.
Return values
Result —A result to work with