vendor/twig/twig/src/Node/TextNode.php line 22

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 text node.
  15.  *
  16.  * @author Fabien Potencier <fabien@symfony.com>
  17.  */
  18. class TextNode extends Node implements NodeOutputInterface
  19. {
  20.     public function __construct(string $dataint $lineno)
  21.     {
  22.         parent::__construct([], ['data' => $data], $lineno);
  23.     }
  24.     public function compile(Compiler $compiler): void
  25.     {
  26.         $compiler
  27.             ->addDebugInfo($this)
  28.             ->write('echo ')
  29.             ->string($this->getAttribute('data'))
  30.             ->raw(";\n")
  31.         ;
  32.     }
  33. }