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

Breadcrumb

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

function Environment::getGlobals

Return value

array<string, mixed>

2 calls to Environment::getGlobals()
Environment::addGlobal in vendor/twig/twig/src/Environment.php
Registers a Global.
Environment::mergeGlobals in vendor/twig/twig/src/Environment.php

File

vendor/twig/twig/src/Environment.php, line 834

Class

Environment
Stores the Twig configuration and renders templates.

Namespace

Twig

Code

public function getGlobals() : array {
    if ($this->extensionSet
        ->isInitialized()) {
        if (null === $this->resolvedGlobals) {
            $this->resolvedGlobals = array_merge($this->extensionSet
                ->getGlobals(), $this->globals);
        }
        return $this->resolvedGlobals;
    }
    return array_merge($this->extensionSet
        ->getGlobals(), $this->globals);
}
RSS feed
Powered by Drupal