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

Breadcrumb

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

function FormFieldRegistry::get

Returns the value of the field based on the fully qualified name and its children.

Return value

FormField|FormField[]|FormField[][]

Throws

\InvalidArgumentException if the field does not exist

2 calls to FormFieldRegistry::get()
FormFieldRegistry::has in vendor/symfony/dom-crawler/FormFieldRegistry.php
Tests whether the form has the given field based on the fully qualified name.
FormFieldRegistry::set in vendor/symfony/dom-crawler/FormFieldRegistry.php
Set the value of a field based on the fully qualified name and its children.

File

vendor/symfony/dom-crawler/FormFieldRegistry.php, line 72

Class

FormFieldRegistry
This is an internal class that must not be used directly.

Namespace

Symfony\Component\DomCrawler

Code

public function &get(string $name) : FormField|array {
    $segments = $this->getSegments($name);
    $target =& $this->fields;
    while ($segments) {
        $path = array_shift($segments);
        if (!\is_array($target) || !\array_key_exists($path, $target)) {
            throw new \InvalidArgumentException(\sprintf('Unreachable field "%s".', $path));
        }
        $target =& $target[$path];
    }
    return $target;
}

API Navigation

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