vendor/twig/twig/src/Node/BlockReferenceNode.php line 24

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of Twig.
  4.  *
  5.  * (c) Fabien Potencier
  6.  * (c) Armin Ronacher
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace Twig\Node;
  12. use Twig\Compiler;
  13. /**
  14.  * Represents a block call node.
  15.  *
  16.  * @author Fabien Potencier <fabien@symfony.com>
  17.  */
  18. class BlockReferenceNode extends Node implements NodeOutputInterface
  19. {
  20.     public function __construct(string $nameint $linenostring $tag null)
  21.     {
  22.         parent::__construct([], ['name' => $name], $lineno$tag);
  23.     }
  24.     public function compile(Compiler $compiler): void
  25.     {
  26.         $compiler
  27.             ->addDebugInfo($this)
  28.             ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n"$this->getAttribute('name')))
  29.         ;
  30.     }
  31. }