Abstract implementation of a form field.
Methods
Constructs a new field.
__construct(array $attributes, string $label)
Parameters
$attributes
array
$label
string
Retrieve the value of an attribute.
__get(string $attribute) : string
Parameters
$attribute
string
Returns
string
Check if an attribute has been set.
__isset(string $attribute) : boolean
Parameters
$attribute
string
Returns
boolean
Set the value of an attribute.
__set(string $attribute, string $value) : \WebLab_Form_Field
Parameters
$attribute
string
$value
string
Returns
Returns the HTML representation of this field.
__toString() : string
Add a validation filter
addFilter(\WebLab_Filter $filter, \unknown_type $errorMessage)
Parameters
$errorMessage
\unknown_type
Shorthand for setAttribute and getAttribute
attr(string $name, string $value) : string
Parameters
$name
string
$value
string
Returns
string
Retrieve the value of an attribute.
getAttribute(string $attribute) : string
Parameters
$attribute
string
Returns
string
Return the label of this field.
getLabel() : string
Retrieve the value.
getValue() : string
Determine if field is correct.
isValid() : boolean | array
Set the value of an attribute.
setAttribute(string $attribute, string $value) : \WebLab_Form_Field
Parameters
$attribute
string
$value
string
Returns
Set the label of this field.
setLabel(string $label)
Set value of this field.
setValue(string $value) : \WebLab_Form_Field
Parameters
$value
string
Returns
Update the field with the response.
update()
Properties