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\DomCrawlerCode
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;
}