File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -38,17 +38,17 @@ The main usage of Symfony UX Swup is to use its Stimulus controller to initializ
3838<html lang="en">
3939 <head>
4040 <title>Swup</title>
41+
42+ {% block javascripts %}
43+ {{ encore_entry_script_tags('app') }}
44+ {% endblock %}
4145 </head>
4246 <body data-controller="symfony--ux-swup--swup">
4347 {# ... #}
4448
4549 <main id="swup">
4650 {# ... #}
4751 </main>
48-
49- {% block javascripts %}
50- {{ encore_entry_script_tags('app') }}
51- {% endblock %}
5252 </body>
5353</html>
5454```
@@ -63,6 +63,10 @@ additional containers, for instance to have a navigation menu that updates when
6363<html lang="en">
6464 <head>
6565 <title>Swup</title>
66+
67+ {% block javascripts %}
68+ {{ encore_entry_script_tags('app') }}
69+ {% endblock %}
6670 </head>
6771 <body
6872 data-controller="symfony--ux-swup--swup"
@@ -77,10 +81,6 @@ additional containers, for instance to have a navigation menu that updates when
7781 <main id="swup">
7882 {# ... #}
7983 </main>
80-
81- {% block javascripts %}
82- {{ encore_entry_script_tags('app') }}
83- {% endblock %}
8484 </body>
8585</html>
8686```
@@ -110,7 +110,7 @@ You can configure several other options using data-attributes on the `body` tag:
110110Symfony UX Swup allows you to extend its default behavior using a custom Stimulus controller:
111111
112112``` js
113- // myswup_controller.js
113+ // assets/controllers/ myswup_controller.js
114114
115115import { Controller } from ' stimulus' ;
116116
@@ -138,6 +138,7 @@ Then in your template, add your controller to the HTML attribute:
138138<html lang="en">
139139 <head>
140140 <title>Swup</title>
141+ {# ... #}
141142 </head>
142143 <body data-controller="myswup symfony--ux-swup--swup">
143144 {# ... #}
You can’t perform that action at this time.
0 commit comments