Methods

setName()

setName(string  $name) : \Pop\Form\Element\ElementInterface

Set the name of the form element

Parameters

string $name

Returns

\Pop\Form\Element\ElementInterface

setValue()

setValue(mixed  $value) : \Pop\Form\Element\ElementInterface

Set the value of the form element

Parameters

mixed $value

Returns

\Pop\Form\Element\ElementInterface

setLabel()

setLabel(mixed  $label) : \Pop\Form\Element\ElementInterface

Set the label of the form element

Parameters

mixed $label

Returns

\Pop\Form\Element\ElementInterface

setLabelAttributes()

setLabelAttributes(array  $attribs) : \Pop\Form\Element\ElementInterface

Set the attributes of the label of the form element

Parameters

array $attribs

Returns

\Pop\Form\Element\ElementInterface

setRequired()

setRequired(boolean  $required) : mixed

Set whether the form element is required

Parameters

boolean $required

Returns

mixed

setDisabled()

setDisabled(boolean  $disabled) : mixed

Set whether the form element is disabled

Parameters

boolean $disabled

Returns

mixed

setReadonly()

setReadonly(boolean  $readonly) : mixed

Set whether the form element is readonly

Parameters

boolean $readonly

Returns

mixed

setErrorPre()

setErrorPre(boolean  $pre) : \Pop\Form\Element\ElementInterface

Set error to display before the element

Parameters

boolean $pre

Returns

\Pop\Form\Element\ElementInterface

isErrorPre()

isErrorPre() : boolean

Determine if error to display before the element

Returns

boolean

setValidators()

setValidators(array  $validators = array()) : \Pop\Form\Element\ElementInterface

Set validators

Parameters

array $validators

Returns

\Pop\Form\Element\ElementInterface

getName()

getName() : string

Get form element name

Returns

string

getType()

getType() : string

Get form element object type

Returns

string

getValue()

getValue() : mixed

Get form element value

Returns

mixed

getLabel()

getLabel() : string

Get form element label

Returns

string

getLabelAttributes()

getLabelAttributes() : array

Get the attributes of the form element label

Returns

array

getValidators()

getValidators() : array

Get validators

Returns

array

isRequired()

isRequired() : boolean

Get whether the form element is required

Returns

boolean

isDisabled()

isDisabled() : boolean

Get whether the form element is disabled

Returns

boolean

isReadonly()

isReadonly() : boolean

Get whether the form element is readonly

Returns

boolean

isButton()

isButton() : boolean

Get whether the form element object is a button

Returns

boolean

getErrors()

getErrors() : array

Get form element errors

Returns

array

hasErrors()

hasErrors() : array

Get if form element has errors

Returns

array

addValidator()

addValidator(mixed  $validator) : \Pop\Form\Element\ElementInterface

Add a validator the form element

Parameters

mixed $validator

Returns

\Pop\Form\Element\ElementInterface

validateValue()

validateValue(mixed  $value, array  $formValues = array()) : void

Validate the value

Parameters

mixed $value
array $formValues

validateCallable()

validateCallable(callable  $validator, mixed  $value, array  $formValues = array()) : void

Validate the value by callable

Parameters

callable $validator
mixed $value
array $formValues

validate()

validate(array  $formValues = array()) : boolean

Validate the form element

Parameters

array $formValues

Returns

boolean