class InputFormField extends FormField

InputFormField represents an input form field (an HTML input tag).

For inputs with type of file, checkbox, or radio, there are other more specialized classes (cf. FileFormField and ChoiceFormField).

Properties

protected DOMElement $node from FormField
protected string $name from FormField
protected string $value from FormField
protected DOMDocument $document from FormField
protected DOMXPath $xpath from FormField
protected bool $disabled from FormField

Methods

__construct(DOMElement $node)

No description

from FormField
DOMElement|null
getLabel()

Returns the label tag associated to the field or null if none.

from FormField
string
getName()

Returns the name of the field.

from FormField
string|array
getValue()

Gets the value of the field.

from FormField
setValue(string $value)

Sets the value of the field.

from FormField
bool
hasValue()

Returns true if the field should be included in the submitted values.

from FormField
bool
isDisabled()

Check if the current field is disabled.

from FormField
initialize()

Initializes the form field.

Details

in FormField at line 49
__construct(DOMElement $node)

Parameters

DOMElement $node The node associated with this field

in FormField at line 63
DOMElement|null getLabel()

Returns the label tag associated to the field or null if none.

Return Value

DOMElement|null

in FormField at line 85
string getName()

Returns the name of the field.

Return Value

string The name of the field

in FormField at line 95
string|array getValue()

Gets the value of the field.

Return Value

string|array The value of the field

in FormField at line 105
setValue(string $value)

Sets the value of the field.

Parameters

string $value The value of the field

in FormField at line 115
bool hasValue()

Returns true if the field should be included in the submitted values.

Return Value

bool true if the field should be included in the submitted values, false otherwise

in FormField at line 125
bool isDisabled()

Check if the current field is disabled.

Return Value

bool

at line 29
protected initialize()

Initializes the form field.

Exceptions

LogicException When node type is incorrect