1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +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 includecss extends \phpbb\template\twig\node\includeasset
/**
* {@inheritdoc}
*/
public function get_definition_name()
public function get_setters_name()
{
return 'STYLESHEETS';
}
/**
* {@inheritdoc}
*/
public function append_asset(\Twig_Compiler $compiler)
{
$compiler
->raw("<link href=\"' . ")
->raw("\$asset_file . '\"")
->raw(' rel="stylesheet" type="text/css" media="screen" />')
;
return 'stylesheet';
}
}