AutoEscape.php 841 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2009 Fabien Potencier
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. /**
  11. * Represents an autoescape node.
  12. *
  13. * The value is the escaping strategy (can be html, js, ...)
  14. *
  15. * The true value is equivalent to html.
  16. *
  17. * If autoescaping is disabled, then the value is false.
  18. *
  19. * @author Fabien Potencier <fabien@symfony.com>
  20. */
  21. class Twig_Node_AutoEscape extends Twig_Node
  22. {
  23. public function __construct($value, Twig_NodeInterface $body, $lineno, $tag = 'autoescape')
  24. {
  25. parent::__construct(array('body' => $body), array('value' => $value), $lineno, $tag);
  26. }
  27. public function compile(Twig_Compiler $compiler)
  28. {
  29. $compiler->subcompile($this->getNode('body'));
  30. }
  31. }