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

Breadcrumb

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

function FormFieldRegistry::add

Adds a field to the registry.

File

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

Class

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

Namespace

Symfony\Component\DomCrawler

Code

public function add(FormField $field) : void {
    $segments = $this->getSegments($field->getName());
    $target =& $this->fields;
    while ($segments) {
        if (!\is_array($target)) {
            $target = [];
        }
        $path = array_shift($segments);
        if ('' === $path) {
            $target =& $target[];
        }
        else {
            $target =& $target[$path];
        }
    }
    $target = $field;
}

API Navigation

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