InputFormField
extends FormField
in package
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).
Tags
Table of Contents
Properties
- $disabled : bool
- $document : DOMDocument
- $name : string
- $node : DOMElement
- $value : string
- $xpath : DOMXPath
Methods
- __construct() : mixed
- getLabel() : DOMElement|null
- Returns the label tag associated to the field or null if none.
- getName() : string
- Returns the name of the field.
- getValue() : string|array<string|int, mixed>
- Gets the value of the field.
- hasValue() : bool
- Returns true if the field should be included in the submitted values.
- isDisabled() : bool
- Check if the current field is disabled.
- setValue() : mixed
- Sets the value of the field.
- initialize() : mixed
- Initializes the form field.
Properties
$disabled
protected
bool
$disabled
$document
protected
DOMDocument
$document
$name
protected
string
$name
$node
protected
DOMElement
$node
$value
protected
string
$value
$xpath
protected
DOMXPath
$xpath
Methods
__construct()
public
__construct(DOMElement $node) : mixed
Parameters
- $node : DOMElement
-
The node associated with this field
getLabel()
Returns the label tag associated to the field or null if none.
public
getLabel() : DOMElement|null
Return values
DOMElement|nullgetName()
Returns the name of the field.
public
getName() : string
Return values
string —The name of the field
getValue()
Gets the value of the field.
public
getValue() : string|array<string|int, mixed>
Return values
string|array<string|int, mixed> —The value of the field
hasValue()
Returns true if the field should be included in the submitted values.
public
hasValue() : bool
Return values
bool —true if the field should be included in the submitted values, false otherwise
isDisabled()
Check if the current field is disabled.
public
isDisabled() : bool
Return values
boolsetValue()
Sets the value of the field.
public
setValue(string|array<string|int, mixed>|bool|null $value) : mixed
Parameters
- $value : string|array<string|int, mixed>|bool|null
-
The value of the field
initialize()
Initializes the form field.
protected
initialize() : mixed