You are here

private function ChoiceFormField::buildOptionValue in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dom-crawler/Field/ChoiceFormField.php \Symfony\Component\DomCrawler\Field\ChoiceFormField::buildOptionValue()

Returns option value with associated disabled flag.

Parameters

\DOMElement $node:

Return value

array

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 258

Class

ChoiceFormField
ChoiceFormField represents a choice form field.

Namespace

Symfony\Component\DomCrawler\Field

Code

private function buildOptionValue(\DOMElement $node) {
  $option = array();
  $defaultValue = isset($node->nodeValue) && !empty($node->nodeValue) ? $node->nodeValue : 'on';
  $option['value'] = $node
    ->hasAttribute('value') ? $node
    ->getAttribute('value') : $defaultValue;
  $option['disabled'] = $node
    ->hasAttribute('disabled');
  return $option;
}