yii\twig\ViewRenderer::addGlobals PHP Method

addGlobals() public method

Adds global objects or static classes
public addGlobals ( array $globals )
$globals array @see self::$globals
    public function addGlobals($globals)
    {
        foreach ($globals as $name => $value) {
            if (!is_object($value)) {
                $value = new ViewRendererStaticClassProxy($value);
            }
            $this->twig->addGlobal($name, $value);
        }
    }