class ChoiceFormField extends FormField
ChoiceFormField represents a choice form field.
It is constructed from a HTML select tag, or a HTML checkbox, or radio inputs.
Methods
|
__construct(DOMNode $node)
Constructor. |
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. |
||
| Boolean |
hasValue()
Returns true if the field should be included in the submitted values. |
|
| Boolean |
isDisabled()
Check if the current field is disabled |
|
|
select(string $value)
Sets the value of the field. |
||
|
tick()
Ticks a checkbox. |
||
|
untick()
Ticks a checkbox. |
||
|
addChoice(DOMNode $node)
Adds a choice to the current ones. |
||
| string |
getType()
Returns the type of the choice field (radio, select, or checkbox). |
|
| Boolean |
isMultiple()
Returns true if the field accepts multiple values. |
|
| bool |
containsOption(string $optionValue, array $options)
Checks whether given vale is in the existing options |
|
| array |
availableOptionValues()
Returns list of available field options |
Details
in FormField at line 51
public
__construct(DOMNode $node)
Constructor.
in FormField at line 71
public string
getName()
Returns the name of the field.
in FormField at line 81
public string|array
getValue()
Gets the value of the field.
at line 120
public
setValue(string $value)
Sets the value of the field.
at line 43
public Boolean
hasValue()
Returns true if the field should be included in the submitted values.
at line 58
public Boolean
isDisabled()
Check if the current field is disabled
at line 76
public
select(string $value)
Sets the value of the field.
at line 88
public
tick()
Ticks a checkbox.
at line 104
public
untick()
Ticks a checkbox.
at line 164
public
addChoice(DOMNode $node)
Adds a choice to the current ones.
This method should only be used internally.
at line 183
public string
getType()
Returns the type of the choice field (radio, select, or checkbox).
at line 193
public Boolean
isMultiple()
Returns true if the field accepts multiple values.
at line 281
public bool
containsOption(string $optionValue, array $options)
Checks whether given vale is in the existing options
at line 297
public array
availableOptionValues()
Returns list of available field options