diff options
Diffstat (limited to 'phpBB/phpbb/template/twig')
-rw-r--r-- | phpBB/phpbb/template/twig/node/includeasset.php | 17 | ||||
-rw-r--r-- | phpBB/phpbb/template/twig/node/includecss.php | 9 | ||||
-rw-r--r-- | phpBB/phpbb/template/twig/node/includejs.php | 9 |
3 files changed, 26 insertions, 9 deletions
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php index 990b1c984f..1cab416c79 100644 --- a/phpBB/phpbb/template/twig/node/includeasset.php +++ b/phpBB/phpbb/template/twig/node/includeasset.php @@ -7,7 +7,7 @@ * */ -class phpbb_template_twig_node_includeasset extends Twig_Node +abstract class phpbb_template_twig_node_includeasset extends Twig_Node { /** @var Twig_Environment */ protected $environment; @@ -57,4 +57,19 @@ class phpbb_template_twig_node_includeasset extends Twig_Node ->raw("\n');\n") ; } + + /** + * Get the definition name + * + * @return string (e.g. 'SCRIPTS') + */ + abstract public function get_definition_name(); + + /** + * Append the output code for the asset + * + * @param Twig_Compiler A Twig_Compiler instance + * @return null + */ + abstract protected function append_asset(Twig_Compiler $compiler); } diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php index 01fda44aad..a9d9b46d69 100644 --- a/phpBB/phpbb/template/twig/node/includecss.php +++ b/phpBB/phpbb/template/twig/node/includecss.php @@ -9,16 +9,17 @@ class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_includeasset { + /** + * {@inheritdoc} + */ public function get_definition_name() { return 'STYLESHEETS'; } /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * {@inheritdoc} + */ public function append_asset(Twig_Compiler $compiler) { $compiler diff --git a/phpBB/phpbb/template/twig/node/includejs.php b/phpBB/phpbb/template/twig/node/includejs.php index fdf2bea3ed..2b4b55fb0a 100644 --- a/phpBB/phpbb/template/twig/node/includejs.php +++ b/phpBB/phpbb/template/twig/node/includejs.php @@ -9,16 +9,17 @@ class phpbb_template_twig_node_includejs extends phpbb_template_twig_node_includeasset { + /** + * {@inheritdoc} + */ public function get_definition_name() { return 'SCRIPTS'; } /** - * Compiles the node to PHP. - * - * @param Twig_Compiler A Twig_Compiler instance - */ + * {@inheritdoc} + */ protected function append_asset(Twig_Compiler $compiler) { $config = $this->environment->get_phpbb_config(); |