Constants

R_EMAIL

R_EMAIL

Defines a requirement as "email format"

R_REQUIRED

R_REQUIRED

Defines a requirement as "value required"

R_NUMERIC

R_NUMERIC

Defines a requirement as "must be numeric"

R_LENGTH_MIN

R_LENGTH_MIN

Defines a requirement as "minimum length"

R_LENGTH_MAX

R_LENGTH_MAX

Defines a requirement as "maximum length"

R_REGEX

R_REGEX

Defines a requirement as "must match regular expression"

R_CONTAIN_UPPERCASE

R_CONTAIN_UPPERCASE

Defines a requirement as "must contain uppercase character"

R_CONTAIN_LOWERCASE

R_CONTAIN_LOWERCASE

Defines a requirement as "must contain lowercase character"

R_CONTAIN_NUMBER

R_CONTAIN_NUMBER

Defines a requirement as "must contain number"

R_CONTAIN_NONALPHANUM

R_CONTAIN_NONALPHANUM

Defines a requirement as "must contain non-alphanumeric character"

R_VAL_LT

R_VAL_LT

Defines a requirement as "numeric value must be lower than"

R_VAL_GT

R_VAL_GT

Defines a requirement as "numeric value must be greater than"

R_VAL_RANGE

R_VAL_RANGE

Defines a requirement as "must be within a supplied range of values"

R_VAL_LTE

R_VAL_LTE

Defines a requirement as "numeric value must be lower than or equal to"

R_VAL_GTE

R_VAL_GTE

Defines a requirement as "numeric value must be greater than or equal to"

E_NONSCALAR

E_NONSCALAR

Error when a value is non-scalar

Properties

$data

$data : array

Supplied data array

Type

array

$binds

$binds : array

Element requirements

Type

array

$evaluation

$evaluation : array

Data array post-evaluation

Type

array

Methods

__construct()

__construct(array  $input) 

Instantiates the class and loads the input array

Parameters

array $input

The input array

bind()

bind(string  $element, array  $requirements) : \Alo\Validators\Form

Binds a set of requirements to an element

Parameters

string $element

The element key

array $requirements

Associative array of requirements

Returns

\Alo\Validators\Form

getEvaluation()

getEvaluation() : array

Returns the evaluation array

Returns

array

getBinds()

getBinds() : array

Returns the binds set

Returns

array

eval_param()

eval_param(string  $data_value, integer  $bind_key, mixed  $bind_value) : boolean

Evaluates an element against a requirement

Parameters

string $data_value

Element value

integer $bind_key

The requirement identifier constant

mixed $bind_value

The requirement specs if applicable

Returns

boolean