We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5dfccb9 commit 3893c72Copy full SHA for 3893c72
book/routing.rst
@@ -1553,6 +1553,18 @@ a template helper function:
1553
Read this blog post.
1554
</a>
1555
1556
+.. tip::
1557
+
1558
+ If you are generating the route inside a script tag, you might need to properly escape it for Javascript
1559
1560
+ .. code-block:: javascript
1561
1562
+ <script>
1563
+ var route = "{{ path('blog_show', {'slug': 'my-blog-post'})|escape('js') }}";
1564
+ </script>
1565
1566
+ For more information, see the Twig documentation.
1567
1568
.. index::
1569
single: Routing; Absolute URLs
1570
0 commit comments