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

Breadcrumb

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

function XmlFileLoader::convertDomElementToArray

Converts a \DOMElement object to a PHP array.

The following rules applies during the conversion:

  • Each tag is converted to a key value or an array if there is more than one "value"
  • The content of a tag is set under a "value" key (<foo>bar</foo>) if the tag also has some nested tags
  • The attributes are converted to keys (<foo foo="bar"/>)
  • The nested-tags are converted to keys (<foo><foo>bar</foo></foo>)

Parameters

\DOMElement $element A \DOMElement instance:

1 call to XmlFileLoader::convertDomElementToArray()
XmlFileLoader::loadFromExtensions in vendor/symfony/dependency-injection/Loader/XmlFileLoader.php
Loads from an extension.

File

vendor/symfony/dependency-injection/Loader/XmlFileLoader.php, line 899

Class

XmlFileLoader
XmlFileLoader loads XML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

public static function convertDomElementToArray(\DOMElement $element) : mixed {
    return XmlUtils::convertDomElementToArray($element, false);
}

API Navigation

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