get query string in symfony twig

Getting Query String in Symfony Twig

To get the query string in Symfony Twig, you can use the app.request.query.all variable. This will give you an array of all the query parameters. Here's an example of how to use it:

{% set queryString = app.request.query.all %}

By using the above code, the queryString variable will contain all the query parameters passed to the current request.

[[SOURCE 1]]