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

Breadcrumb

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

function ExtensionSet::getGlobals

Return value

array<string, mixed>

File

vendor/twig/twig/src/ExtensionSet.php, line 318

Class

ExtensionSet
@author Fabien Potencier <fabien@symfony.com>

Namespace

Twig

Code

public function getGlobals() : array {
    if (null !== $this->globals) {
        return $this->globals;
    }
    $globals = [];
    foreach ($this->extensions as $extension) {
        if (!$extension instanceof GlobalsInterface) {
            continue;
        }
        $globals = array_merge($globals, $extension->getGlobals());
    }
    if ($this->initialized) {
        $this->globals = $globals;
    }
    return $globals;
}
RSS feed
Powered by Drupal