ElementInterface
in
Form element interface
Tags
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
addValidator()
Add a validator the form element
public
addValidator(mixed $validator) : ElementInterface
Parameters
- $validator : mixed
Return values
ElementInterface —clearErrors()
Clear errors
public
clearErrors() : ElementInterface
Return values
ElementInterface —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 —resetValue()
Reset the value of the form element
public
resetValue() : ElementInterface
Return values
ElementInterface —setDisabled()
Set whether the form element is disabled
public
setDisabled(bool $disabled) : mixed
Parameters
- $disabled : bool
Return values
mixed —setErrorPre()
Set error to display before the element
public
setErrorPre(bool $pre) : ElementInterface
Parameters
- $pre : bool
Return values
ElementInterface —setLabel()
Set the label of the form element
public
setLabel(mixed $label) : ElementInterface
Parameters
- $label : mixed
Return values
ElementInterface —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 —setName()
Set the name of the form element
public
setName(string $name) : ElementInterface
Parameters
- $name : string
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 —setValidators()
Set validators
public
setValidators([array<string|int, mixed> $validators = [] ]) : ElementInterface
Parameters
- $validators : array<string|int, mixed> = []
Return values
ElementInterface —setValue()
Set the value of the form element
public
setValue(mixed $value) : ElementInterface
Parameters
- $value : mixed
Return values
ElementInterface —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> = []