From ea785efb30ced6ab399b290df6f202cb97315f80 Mon Sep 17 00:00:00 2001 From: Nathaniel Guse Date: Tue, 25 Jun 2013 14:22:40 -0500 Subject: [feature/twig] PHP token support PHPBB3-11598 --- phpBB/includes/template/twig/node/php.php | 40 +++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 phpBB/includes/template/twig/node/php.php (limited to 'phpBB/includes/template/twig/node/php.php') diff --git a/phpBB/includes/template/twig/node/php.php b/phpBB/includes/template/twig/node/php.php new file mode 100644 index 0000000000..cf60ef33fc --- /dev/null +++ b/phpBB/includes/template/twig/node/php.php @@ -0,0 +1,40 @@ +environment = $environment; + + parent::__construct(array('text' => $text), array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Twig_Compiler A Twig_Compiler instance + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $config = $this->environment->get_phpbb_config(); + + if ($config['tpl_allow_php']) + { + $compiler + ->raw($this->getNode('text')->getAttribute('data')) + ; + } + } +} -- cgit v1.2.1