From 81afbd472f5d90e296b91a87e1debeb42f0ed28c Mon Sep 17 00:00:00 2001 From: Antoine Makdessi Date: Thu, 16 Dec 2021 14:45:29 +0100 Subject: [PATCH] Move JavaScript entry function in the HTML head --- templates/base.html.twig | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/templates/base.html.twig b/templates/base.html.twig index 4a7a70935..4f3cfef96 100644 --- a/templates/base.html.twig +++ b/templates/base.html.twig @@ -10,9 +10,17 @@ {% block title %}Symfony Demo application{% endblock %} + + {# + Those two blocks defines frontend entrypoint for CSS and JavaScript assets + See https://symfony.com/doc/current/frontend.html + #} {% block stylesheets %} {{ encore_entry_link_tags('app') }} {% endblock %} + {% block javascripts %} + {{ encore_entry_script_tags('app') }} + {% endblock %} @@ -150,10 +158,6 @@ {% endblock %} - {% block javascripts %} - {{ encore_entry_script_tags('app') }} - {% endblock %} - {# it's not mandatory to set the timezone in localizeddate(). This is done to avoid errors when the 'intl' PHP extension is not available and the application is forced to use the limited "intl polyfill", which only supports UTC and GMT #}