FormThemeNode.php 975 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Bridge\Twig\Node;
  11. use Twig\Compiler;
  12. use Twig\Node\Node;
  13. /**
  14. * @author Fabien Potencier <fabien@symfony.com>
  15. */
  16. class FormThemeNode extends Node
  17. {
  18. public function __construct(Node $form, Node $resources, $lineno, $tag = null)
  19. {
  20. parent::__construct(array('form' => $form, 'resources' => $resources), array(), $lineno, $tag);
  21. }
  22. public function compile(Compiler $compiler)
  23. {
  24. $compiler
  25. ->addDebugInfo($this)
  26. ->write('$this->env->getRuntime(\'Symfony\Bridge\Twig\Form\TwigRenderer\')->setTheme(')
  27. ->subcompile($this->getNode('form'))
  28. ->raw(', ')
  29. ->subcompile($this->getNode('resources'))
  30. ->raw(");\n");
  31. }
  32. }