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

Breadcrumb

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

function EmbedNode::addGetTemplate

Overrides IncludeNode::addGetTemplate

File

vendor/twig/twig/src/Node/EmbedNode.php, line 36

Class

EmbedNode
Represents an embed node.

Namespace

Twig\Node

Code

protected function addGetTemplate(Compiler $compiler, string $template = '') : void {
    $compiler->raw('$this->loadTemplate(')
        ->string($this->getAttribute('name'))
        ->raw(', ')
        ->repr($this->getTemplateName())
        ->raw(', ')
        ->repr($this->getTemplateLine())
        ->raw(', ')
        ->string($this->getAttribute('index'))
        ->raw(')');
    if ($this->getAttribute('ignore_missing')) {
        $compiler->raw(";\n")
            ->write(\sprintf("\$%s->getParent(\$context);\n", $template));
    }
}

API Navigation

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