Abstract implementation of a form field.

author Jorgen Evens
package WebLab
subpackage Form

 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
deprecated

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
deprecated

Parameters

$attribute

string

$value

string

Returns

Returns the HTML representation of this field.

__toString() : string

Returns

string

Add a validation filter

addFilter(\WebLab_Filter $filter, \unknown_type $errorMessage) 

Parameters

$filter

\WebLab_Filter

$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 form to which this field belongs.

getForm() : \WebLab_Form

Returns

Return the label of this field.

getLabel() : string

Returns

string

Retrieve the value.

getValue() : string

Returns

string

Determine if field is correct.

isValid() : boolean | array

Returns

booleanarray

Set the value of an attribute.

setAttribute(string $attribute, string $value) : \WebLab_Form_Field

Parameters

$attribute

string

$value

string

Returns

Set the to which this field belongs.

setForm(\WebLab_Form $form) : \WebLab_Form_Field

Parameters

$form

\WebLab_Form

Returns

Set the label of this field.

setLabel(string $label) 

Parameters

$label

string

Set value of this field.

setValue(string $value) : \WebLab_Form_Field

Parameters

$value

string

Returns

Update the field with the response.

update() 

 Properties

 

$_attributes : array
 

$_filters : array
 

$_form : \WebLab_Form
 

$_label : string