environment = $environment; parent::__construct(array('expr' => $expr), 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(); $compiler ->write("\$js_file = ") ->subcompile($this->getNode('expr')) ->raw(";\n") ->write("if (!file_exists(\$js_file)) {\n") ->indent() ->write("\$js_file = \$this->getEnvironment()->getLoader()->getCacheKey(\$js_file);\n") ->outdent() ->write("}\n") ->write("\$context['definition']->append('SCRIPTS', '\n');\n") ; } }