79e8e41105222615455de2a7a3717c5417ec44b8
[packbundle] / Twig / PackNode.php
1 <?php
2
3 namespace Rapsys\PackBundle\Twig;
4
5 class PackNode extends \Twig\Node\Node {
6 /**
7 * Compile the body node
8 *
9 * @param $compiler
10 */
11 public function compile(\Twig\Compiler $compiler) {
12 //Add $context['<name>'] = '<value>'; in twig template
13 $compiler
14 ->addDebugInfo($this)
15 ->write('$context[\''.$this->getAttribute('name').'\'] = ')
16 ->repr($this->getAttribute('output'))
17 ->raw(";\n")
18 ->subcompile($this->getNode('value'))
19 ->raw(";\n");
20 }
21 }