TempName.php 546B

1234567891011121314151617181920212223
  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->raw('$_')->raw($this->getAttribute('name'))->raw('_');
  19. }
  20. }