Properties

$validators

$validators : array

Form validators

Type

array

$required

$required : array

Required fields

Type

array

$values

$values : array

Form values

Type

array

$errors

$errors : array

Form validation errors

Type

array

Methods

count()

count() : integer

Count of values

Returns

integer

toArray()

toArray() : array

Get values

Returns

array

getIterator()

getIterator() : \ArrayIterator

Method to iterate over the form elements

Returns

\ArrayIterator

__set()

__set(string  $name, mixed  $value) : void

Set method to set the property to the value of values[$name]

Parameters

string $name
mixed $value

__get()

__get(string  $name) : mixed

Get method to return the value of values[$name]

Parameters

string $name

Returns

mixed

__isset()

__isset(string  $name) : boolean

Return the isset value of values[$name]

Parameters

string $name

Returns

boolean

__unset()

__unset(string  $name) : void

Unset values[$name]

Parameters

string $name

offsetExists()

offsetExists(mixed  $offset) : boolean

ArrayAccess offsetExists

Parameters

mixed $offset

Returns

boolean

offsetGet()

offsetGet(mixed  $offset) : mixed

ArrayAccess offsetGet

Parameters

mixed $offset

Returns

mixed

offsetSet()

offsetSet(mixed  $offset, mixed  $value) : void

ArrayAccess offsetSet

Parameters

mixed $offset
mixed $value

offsetUnset()

offsetUnset(mixed  $offset) : void

ArrayAccess offsetUnset

Parameters

mixed $offset

__construct()

__construct(array  $validators = null, mixed  $required = null, array  $values = null, mixed  $filters = null) 

Constructor

Instantiate the form validator object

Parameters

array $validators
mixed $required
array $values
mixed $filters

createFromConfig()

createFromConfig(array|\Pop\Form\FormConfig  $formConfig, mixed  $required = null, array  $values = null, mixed  $filters = null) : \Pop\Form\FormValidator

Create form validator from config

Parameters

array|\Pop\Form\FormConfig $formConfig
mixed $required
array $values
mixed $filters

Returns

\Pop\Form\FormValidator

addValidators()

addValidators(array  $validators) : \Pop\Form\FormValidator

Add validators

Parameters

array $validators

Returns

\Pop\Form\FormValidator

addValidator()

addValidator(string  $field, mixed  $validator) : \Pop\Form\FormValidator

Add validator

Parameters

string $field
mixed $validator

Returns

\Pop\Form\FormValidator

hasValidators()

hasValidators(string  $field = null) : boolean

Has validators

Parameters

string $field

Returns

boolean

getValidators()

getValidators(string  $field = null) : mixed

Get validators

Parameters

string $field

Returns

mixed

hasValidator()

hasValidator(string  $field, integer  $index) : boolean

Has validator

Parameters

string $field
integer $index

Returns

boolean

getValidator()

getValidator(string  $field, integer  $index) : mixed

Get validator

Parameters

string $field
integer $index

Returns

mixed

removeValidators()

removeValidators(string  $field = null) : \Pop\Form\FormValidator

Remove validators

Parameters

string $field

Returns

\Pop\Form\FormValidator

removeValidator()

removeValidator(string  $field, integer  $index) : \Pop\Form\FormValidator

Remove validator

Parameters

string $field
integer $index

Returns

\Pop\Form\FormValidator

setRequired()

setRequired(mixed  $required) : \Pop\Form\FormValidator

Set required

Parameters

mixed $required

Returns

\Pop\Form\FormValidator

isRequired()

isRequired(string  $field) : boolean

Is required

Parameters

string $field

Returns

boolean

removeRequired()

removeRequired(string  $field) : \Pop\Form\FormValidator

Remove required

Parameters

string $field

Returns

\Pop\Form\FormValidator

setValues()

setValues(array  $values) : \Pop\Form\FormValidator

Set values

Parameters

array $values

Returns

\Pop\Form\FormValidator

getValues()

getValues() : array

Get values

Returns

array

filterValue()

filterValue(mixed  $field) : mixed

Filter value with the filters

Parameters

mixed $field

Returns

mixed

filter()

filter(array  $values = null) : array

Filter values with the filters

Parameters

array $values

Returns

array

validate()

validate() : boolean

Validate values

Returns

boolean

hasErrors()

hasErrors(string  $field = null) : boolean

Has errors

Parameters

string $field

Returns

boolean

getErrors()

getErrors(string  $field = null) : array

Get errors

Parameters

string $field

Returns

array

getError()

getError(string  $field, integer  $index) : mixed

Get error

Parameters

string $field
integer $index

Returns

mixed

addError()

addError(string  $field, string  $error) : \Pop\Form\FormValidator

Add error

Parameters

string $field
string $error

Returns

\Pop\Form\FormValidator