AssignName.php 616B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /*
  3. * This file is part of Twig.
  4. *
  5. * (c) 2009 Fabien Potencier
  6. * (c) 2009 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. class Twig_Node_Expression_AssignName extends Twig_Node_Expression_Name
  12. {
  13. /**
  14. * Compiles the node to PHP.
  15. *
  16. * @param Twig_Compiler A Twig_Compiler instance
  17. */
  18. public function compile(Twig_Compiler $compiler)
  19. {
  20. $compiler
  21. ->raw('$context[')
  22. ->string($this->getAttribute('name'))
  23. ->raw(']')
  24. ;
  25. }
  26. }