view src/Kachkaev/JstmplBundle/Twig/JstmplNode.php @ 0:493bcb69166c

added public content
author Daniel Wolff
date Tue, 09 Feb 2016 20:54:02 +0100
parents
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");
    }
}