You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/routing.rst
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1550,6 +1550,30 @@ a template helper function:
1550
1550
Read this blog post.
1551
1551
</a>
1552
1552
1553
+
..tip::
1554
+
1555
+
If you are generating the route inside a ``<script>`` element, it's a good
1556
+
practice to escape it for #"diff-cfd5991f69c12b062d3273e07b1bb164b139ac4e31186f703b3e0dc815c48734-1552-1557-0" data-selected="false" role="gridcell" tabindex="-1" valign="top">
1557
+
1558
+
..configuration-block::
1559
+
1560
+
..code-block::html+twig
1561
+
1562
+
<script>
1563
+
var route = "{{ path('blog_show', {'slug': 'my-blog-post'})|escape('js') }}";