Twig_Node_SetTemp

This file is part of Twig.

Defined (1)

The class is defined in the following location(s).

/vendor/twig/twig/lib/Twig/Node/SetTemp.php  
  1. class Twig_Node_SetTemp extends Twig_Node 
  2. public function __construct($name, $lineno) 
  3. parent::__construct(array(), array('name' => $name), $lineno); 
  4.  
  5. public function compile(Twig_Compiler $compiler) 
  6. $name = $this->getAttribute('name'); 
  7. $compiler 
  8. ->addDebugInfo($this) 
  9. ->write('if (isset($context[') 
  10. ->string($name) 
  11. ->raw('])) { $_') 
  12. ->raw($name) 
  13. ->raw('_ = $context[') 
  14. ->repr($name) 
  15. ->raw(']; } else { $_') 
  16. ->raw($name) 
  17. ->raw("_ = null; }\n")