Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TextareaFormField.php

function 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() : void {
    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;
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal