]> Raphaƫl G. Git Repositories - packbundle/blob - Twig/PackNode.php
Update to 4.x new path
[packbundle] / Twig / PackNode.php
1 <?php
2 // src/Rapsys/PackBundle/Twig/PackTokenParser.php
3 namespace Rapsys\PackBundle\Twig;
4
5 class PackNode extends \Twig_Node {
6 #public function __construct($name, $value, $line, $tag = null) {
7 # parent::__construct(array('value' => $value), array('name' => $name), $line, $tag);
8 #}
9 public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null) {
10 parent::__construct($nodes, $attributes, $lineno, $tag);
11 #$this->output = $attributes['output'];
12 #$this->setAttribute($this->getAttribute('name'), $attributes['name']);
13 }
14
15 public function compile(\Twig_Compiler $compiler) {
16
17 #header('Content-Type: text/plain');
18 #var_dump($this->getNode(0));
19 #var_dump($this->attributes);
20 #var_dump($compiler->subcompile($this->getNode(0)));
21 #exit;
22 #$compiler->addDebugInfo($this)->write('echo \'<pre>'.json_encode(array('nodes' => $this->nodes, 'attributes' => $this->attributes)).'</pre>\';');
23 $compiler
24 ->addDebugInfo($this)
25 ->write('$context[\''.$this->getAttribute('name').'\'] = ')
26 ->repr($this->getAttribute('output'))
27 ->raw(";\n")
28 ->subcompile($this->getNode('value'))
29 ->raw(";\n");
30 }
31 }