1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 17:56:52 +02:00

[ticket/13717] Set the assets after rendering the whole template

The goal being to be able to call INCLUDECSS/JS from anywhere in any tempalte or event

PHPBB3-13717
This commit is contained in:
Tristan Darricau
2016-01-17 20:11:36 +01:00
parent d8af5ac4f9
commit 52b3d54805
5 changed files with 160 additions and 48 deletions

View File

@@ -18,20 +18,8 @@ class includejs extends \phpbb\template\twig\node\includeasset
/**
* {@inheritdoc}
*/
public function get_definition_name()
public function get_setters_name()
{
return 'SCRIPTS';
}
/**
* {@inheritdoc}
*/
protected function append_asset(\Twig_Compiler $compiler)
{
$compiler
->raw("<script type=\"text/javascript\" src=\"' . ")
->raw("\$asset_file")
->raw(". '\"></script>\n")
;
return 'script';
}
}