From: Raphaƫl Gertz Date: Tue, 26 Nov 2019 12:34:47 +0000 (+0100) Subject: Cleanup X-Git-Tag: 0.1.3~16 X-Git-Url: https://git.rapsys.eu/packbundle/commitdiff_plain/473d0c32a2cd4abd514f87950e8b254e797ffc7e Cleanup --- 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').'\'] = ')