Skip to content

Commit 81afbd4

Browse files
Antoine MakdessiAntoine Makdessi
Antoine Makdessi
authored and
Antoine Makdessi
committed
Move JavaScript entry function in the HTML head
1 parent 77a47d3 commit 81afbd4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

templates/base.html.twig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,17 @@
1010
<meta name="viewport" content="width=device-width, initial-scale=1"/>
1111
<title>{% block title %}Symfony Demo application{% endblock %}</title>
1212
<link rel="alternate" type="application/rss+xml" title="{{ 'rss.title'|trans }}" href="{{ path('blog_rss') }}">
13+
14+
{#
15+
Those two blocks defines frontend entrypoint for CSS and JavaScript assets
16+
See https://symfony.com/doc/current/frontend.html
17+
#}
1318
{% block stylesheets %}
1419
{{ encore_entry_link_tags('app') }}
1520
{% endblock %}
21+
{% block javascripts %}
22+
{{ encore_entry_script_tags('app') }}
23+
{% endblock %}
1624

1725
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
1826
</head>
@@ -150,10 +158,6 @@
150158
</footer>
151159
{% endblock %}
152160

153-
{% block javascripts %}
154-
{{ encore_entry_script_tags('app') }}
155-
{% endblock %}
156-
157161
{# it's not mandatory to set the timezone in localizeddate(). This is done to
158162
avoid errors when the 'intl' PHP extension is not available and the application
159163
is forced to use the limited "intl polyfill", which only supports UTC and GMT #}

0 commit comments

Comments
 (0)