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

Breadcrumb

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

function BlockReferenceExpression::compile

Overrides Node::compile

File

vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php, line 42

Class

BlockReferenceExpression
Represents a block call node.

Namespace

Twig\Node\Expression

Code

public function compile(Compiler $compiler) : void {
    if ($this->getAttribute('is_defined_test')) {
        $this->compileTemplateCall($compiler, 'hasBlock');
    }
    else {
        if ($this->getAttribute('output')) {
            $compiler->addDebugInfo($this);
            $compiler->write('yield from ');
            $this->compileTemplateCall($compiler, 'yieldBlock')
                ->raw(";\n");
        }
        else {
            $this->compileTemplateCall($compiler, 'renderBlock');
        }
    }
}
RSS feed
Powered by Drupal