view src/Kachkaev/JstmplBundle/Twig/JstmplNode.php @ 1:f38015048f48 tip

Added GPL
author Daniel Wolff
date Sat, 13 Feb 2016 20:43:38 +0100
parents 493bcb69166c
children
line wrap: on
line source
<?php

namespace Kachkaev\JstmplBundle\Twig;

class JstmplNode extends \Twig_Node
{
    public function __construct($id, \Twig_Node $body, $lineno)
    {
        parent::__construct(array('body' => $body), array('id' => $id), $lineno);
    }

    public function compile(\Twig_Compiler $compiler)
    {
        $compiler->addDebugInfo($this);
        $compiler->write("	echo \"<script id=\\\"".$this->getAttribute('id')."\\\" type=\\\"text/html\\\">\";\n");
        $compiler->subcompile($this->getNode('body'));
        $compiler->write("	echo \"</script>\\n\\n\";\n");
    }
}