Documentation

ElementInterface
in

Form element interface

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2021 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
3.6.0

Table of Contents

addValidator()  : ElementInterface
Add a validator the form element
clearErrors()  : ElementInterface
Clear errors
getErrors()  : array<string|int, mixed>
Get form element errors
getLabel()  : string
Get form element label
getLabelAttributes()  : array<string|int, mixed>
Get the attributes of the form element label
getName()  : string
Get form element name
getType()  : string
Get form element object type
getValidators()  : array<string|int, mixed>
Get validators
getValue()  : mixed
Get form element value
hasErrors()  : array<string|int, mixed>
Get if form element has errors
isButton()  : bool
Get whether the form element object is a button
isDisabled()  : bool
Get whether the form element is disabled
isErrorPre()  : bool
Determine if error to display before the element
isReadonly()  : bool
Get whether the form element is readonly
isRequired()  : bool
Get whether the form element is required
resetValue()  : ElementInterface
Reset the value of the form element
setDisabled()  : mixed
Set whether the form element is disabled
setErrorPre()  : ElementInterface
Set error to display before the element
setLabel()  : ElementInterface
Set the label of the form element
setLabelAttributes()  : ElementInterface
Set the attributes of the label of the form element
setName()  : ElementInterface
Set the name of the form element
setReadonly()  : mixed
Set whether the form element is readonly
setRequired()  : mixed
Set whether the form element is required
setValidators()  : ElementInterface
Set validators
setValue()  : ElementInterface
Set the value of the form element
validate()  : bool
Validate the form element
validateCallable()  : void
Validate the value by callable
validateValue()  : void
Validate the value

Methods

getErrors()

Get form element errors

public getErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>

getLabel()

Get form element label

public getLabel() : string
Return values
string

getLabelAttributes()

Get the attributes of the form element label

public getLabelAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed>

getName()

Get form element name

public getName() : string
Return values
string

getType()

Get form element object type

public getType() : string
Return values
string

getValidators()

Get validators

public getValidators() : array<string|int, mixed>
Return values
array<string|int, mixed>

getValue()

Get form element value

public getValue() : mixed
Return values
mixed

hasErrors()

Get if form element has errors

public hasErrors() : array<string|int, mixed>
Return values
array<string|int, mixed>

isButton()

Get whether the form element object is a button

public isButton() : bool
Return values
bool

isDisabled()

Get whether the form element is disabled

public isDisabled() : bool
Return values
bool

isErrorPre()

Determine if error to display before the element

public isErrorPre() : bool
Return values
bool

isReadonly()

Get whether the form element is readonly

public isReadonly() : bool
Return values
bool

isRequired()

Get whether the form element is required

public isRequired() : bool
Return values
bool

setDisabled()

Set whether the form element is disabled

public setDisabled(bool $disabled) : mixed
Parameters
$disabled : bool
Return values
mixed

setLabelAttributes()

Set the attributes of the label of the form element

public setLabelAttributes(array<string|int, mixed> $attribs) : ElementInterface
Parameters
$attribs : array<string|int, mixed>
Return values
ElementInterface

setReadonly()

Set whether the form element is readonly

public setReadonly(bool $readonly) : mixed
Parameters
$readonly : bool
Return values
mixed

setRequired()

Set whether the form element is required

public setRequired(bool $required) : mixed
Parameters
$required : bool
Return values
mixed

validate()

Validate the form element

public validate([array<string|int, mixed> $formValues = [] ]) : bool
Parameters
$formValues : array<string|int, mixed> = []
Return values
bool

validateCallable()

Validate the value by callable

public validateCallable(callable $validator, mixed $value[, array<string|int, mixed> $formValues = [] ]) : void
Parameters
$validator : callable
$value : mixed
$formValues : array<string|int, mixed> = []
Return values
void

validateValue()

Validate the value

public validateValue(mixed $value[, array<string|int, mixed> $formValues = [] ]) : void
Parameters
$value : mixed
$formValues : array<string|int, mixed> = []
Return values
void

Search results