From 4f5b44bd3bd490309eb2ba7b44df4769816ba729 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Sat, 3 Aug 2013 19:26:54 +0200 Subject: twig implementation --- .../Symfony/Bridge/Twig/Node/FormThemeNode.php | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Node/FormThemeNode.php (limited to 'vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Node/FormThemeNode.php') diff --git a/vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Node/FormThemeNode.php b/vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Node/FormThemeNode.php new file mode 100644 index 00000000..329ab86f --- /dev/null +++ b/vendor/symfony/twig-bridge/Symfony/Bridge/Twig/Node/FormThemeNode.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bridge\Twig\Node; + +/** + * @author Fabien Potencier + */ +class FormThemeNode extends \Twig_Node +{ + public function __construct(\Twig_NodeInterface $form, \Twig_NodeInterface $resources, $lineno, $tag = null) + { + parent::__construct(array('form' => $form, 'resources' => $resources), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param \Twig_Compiler $compiler A Twig_Compiler instance + */ + public function compile(\Twig_Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('$this->env->getExtension(\'form\')->renderer->setTheme(') + ->subcompile($this->getNode('form')) + ->raw(', ') + ->subcompile($this->getNode('resources')) + ->raw(");\n"); + ; + } +} -- cgit v1.2.3