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

Breadcrumb

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

function TemplateVariable::compile

Overrides TempNameExpression::compile

File

vendor/twig/twig/src/Node/Expression/Variable/TemplateVariable.php, line 28

Class

TemplateVariable

Namespace

Twig\Node\Expression\Variable

Code

public function compile(Compiler $compiler) : void {
    $name = $this->getName($compiler);
    if ('_self' === $name) {
        $compiler->raw('$this');
    }
    else {
        $compiler->raw('$macros[')
            ->string($name)
            ->raw(']');
    }
}

API Navigation

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