Documentation

FormResult
in package

Holds the result of a validation of a form

Table of Contents

$doNothing  : bool
$errors  : array<string|int, object>
$fields  : array<string|int, FormField>
$hasErrors  : bool
__construct()  : mixed
Creates a new FormResult object
addCustomError()  : mixed
Adds a custom error to the form result
getValue()  : mixed
Gets a validated input value

Properties

$doNothing

public bool $doNothing

When set, no CED action will be performed when this object is given into one.

$errors

public array<string|int, object> $errors

Holds the errors of the validation

$hasErrors

public bool $hasErrors

Set when the input data was invalid

Methods

__construct()

Creates a new FormResult object

public __construct() : mixed
Return values
mixed

addCustomError()

Adds a custom error to the form result

public addCustomError(string $name, string $type) : mixed
Parameters
$name : string

Name of the form field to assign the error to

$type : string

Type of the error. Influences the error message

Return values
mixed

getValue()

Gets a validated input value

public getValue(string $name) : mixed
Parameters
$name : string

Name of the field to get the value from

Return values
mixed

Search results