You are here

protected function TextareaFormField::initialize in Zircon Profile 8.0

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

Initializes the form field.

Throws

\LogicException When node type is incorrect

Overrides FormField::initialize

File

vendor/symfony/dom-crawler/Field/TextareaFormField.php, line 26

Class

TextareaFormField
TextareaFormField represents a textarea form field (an HTML textarea tag).

Namespace

Symfony\Component\DomCrawler\Field

Code

protected function initialize() {
  if ('textarea' !== $this->node->nodeName) {
    throw new \LogicException(sprintf('A TextareaFormField can only be created from a textarea tag (%s given).', $this->node->nodeName));
  }
  $this->value = '';
  foreach ($this->node->childNodes as $node) {
    $this->value .= $node->wholeText;
  }
}