function ChoiceFormField::buildOptionValue
Returns option value with associated disabled flag.
2 calls to ChoiceFormField::buildOptionValue()
- ChoiceFormField::addChoice in vendor/
symfony/ dom-crawler/ Field/ ChoiceFormField.php - Adds a choice to the current ones.
- ChoiceFormField::initialize in vendor/
symfony/ dom-crawler/ Field/ ChoiceFormField.php - Initializes the form field.
File
-
vendor/
symfony/ dom-crawler/ Field/ ChoiceFormField.php, line 234
Class
- ChoiceFormField
- ChoiceFormField represents a choice form field.
Namespace
Symfony\Component\DomCrawler\FieldCode
private function buildOptionValue(\DOMElement $node) : array {
$option = [];
$defaultDefaultValue = 'select' === $this->node->nodeName ? '' : 'on';
$defaultValue = isset($node->nodeValue) && $node->nodeValue ? $node->nodeValue : $defaultDefaultValue;
$option['value'] = $node->hasAttribute('value') ? $node->getAttribute('value') : $defaultValue;
$option['disabled'] = $node->hasAttribute('disabled');
return $option;
}