Documentation

ElementInterface
in

Form element interface

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

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

license

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

version
4.0.0

Table of Contents

Methods

addValidator()  : ElementInterface
Add a validator the form element
clearErrors()  : ElementInterface
Clear errors
getErrors()  : array<string|int, mixed>
Get form element errors
getLabel()  : string|null
Get form element label
getLabelAttributes()  : array<string|int, mixed>
Get the attributes of the form element label
getName()  : string|null
Get form element name
getType()  : string|null
Get form element object type
getValidators()  : array<string|int, mixed>
Get validators
getValue()  : mixed
Get form element value
hasErrors()  : bool
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|null
Return values
string|null

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|null
Return values
string|null

getType()

Get form element object type

public getType() : string|null
Return values
string|null

getValidators()

Get validators

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

hasErrors()

Get if form element has errors

public hasErrors() : bool
Return values
bool

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

setReadonly()

Set whether the form element is readonly

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

setRequired()

Set whether the form element is required

public setRequired(bool $required[, string|null $requiredMessage = 'This field is required.' ]) : mixed
Parameters
$required : bool
$requiredMessage : string|null = 'This field is required.'

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> = []

validateValue()

Validate the value

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

        
On this page

Search results