public function Twig_Environment::getGlobals

Gets the registered Globals.

Return value

array An array of globals

1 call to Twig_Environment::getGlobals()
Twig_Environment::mergeGlobals in drupal/core/vendor/twig/twig/lib/Twig/Environment.php
Merges a context with the defined globals.

File

drupal/core/vendor/twig/twig/lib/Twig/Environment.php, line 988

Class

Twig_Environment
Stores the Twig configuration.

Code

public function getGlobals() {
  if (null === $this->globals) {
    $this->globals = isset($this->staging['globals']) ? $this->staging['globals'] : array();
    foreach ($this
      ->getExtensions() as $extension) {
      $this->globals = array_merge($this->globals, $extension
        ->getGlobals());
    }
  }
  return $this->globals;
}