X-Git-Url: https://git.rapsys.eu/packbundle/blobdiff_plain/927f1bdefc0a2a33ad37866745bb514ab21d1a84..473d0c32a2cd4abd514f87950e8b254e797ffc7e:/Twig/PackNode.php diff --git a/Twig/PackNode.php b/Twig/PackNode.php index 4f08be0..79e8e41 100644 --- a/Twig/PackNode.php +++ b/Twig/PackNode.php @@ -1,25 +1,15 @@ $value), array('name' => $name), $line, $tag); - #} - public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null) { - parent::__construct($nodes, $attributes, $lineno, $tag); - #$this->output = $attributes['output']; - #$this->setAttribute($this->getAttribute('name'), $attributes['name']); - } - public function compile(\Twig_Compiler $compiler) { +namespace Rapsys\PackBundle\Twig; - #header('Content-Type: text/plain'); - #var_dump($this->getNode(0)); - #var_dump($this->attributes); - #var_dump($compiler->subcompile($this->getNode(0))); - #exit; - #$compiler->addDebugInfo($this)->write('echo \'
'.json_encode(array('nodes' => $this->nodes, 'attributes' => $this->attributes)).'
\';'); +class PackNode extends \Twig\Node\Node { + /** + * Compile the body node + * + * @param $compiler + */ + public function compile(\Twig\Compiler $compiler) { + //Add $context[''] = ''; in twig template $compiler ->addDebugInfo($this) ->write('$context[\''.$this->getAttribute('name').'\'] = ')