TempName.php 594B

123456789101112131415161718192021222324252627
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2011 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. class Twig_Node_Expression_TempName extends Twig_Node_Expression
  11. {
  12. public function __construct($name, $lineno)
  13. {
  14. parent::__construct(array(), array('name' => $name), $lineno);
  15. }
  16. public function compile(Twig_Compiler $compiler)
  17. {
  18. $compiler
  19. ->raw('$_')
  20. ->raw($this->getAttribute('name'))
  21. ->raw('_')
  22. ;
  23. }
  24. }