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.
__construct(DOMElement $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. | ||
bool | hasValue() Returns true if the field should be included in the submitted values. | |
bool | isDisabled() Check if the current selected option is disabled. | |
select(string $value) Sets the value of the field. | ||
tick() Ticks a checkbox. | ||
untick() Ticks a checkbox. | ||
addChoice(DOMElement $node) Adds a choice to the current ones. | ||
string | getType() Returns the type of the choice field (radio, select, or checkbox). | |
bool | isMultiple() Returns true if the field accepts multiple values. | |
bool | containsOption(string $optionValue, array $options) Checks whether given value is in the existing options. | |
array | availableOptionValues() Returns list of available field options. | |
ChoiceFormField | disableValidation() Disables the internal validation of the field. |
Constructor.
Returns the name of the field.
Gets the value of the field.
Sets the value of the field.
Returns true if the field should be included in the submitted values.
Check if the current selected option is disabled.
Sets the value of the field.
Ticks a checkbox.
Ticks a checkbox.
Adds a choice to the current ones.
This method should only be used internally.
Returns the type of the choice field (radio, select, or checkbox).
Returns true if the field accepts multiple values.
Checks whether given value is in the existing options.
Returns list of available field options.
Disables the internal validation of the field.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/2.8/Symfony/Component/DomCrawler/Field/ChoiceFormField.html