File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -1581,15 +1581,11 @@ information in a controller via the ``Request`` object::
1581
1581
}
1582
1582
}
1583
1583
1584
- You can get this information in services too injecting the ``request_stack ``
1585
- service to :doc: `get the Request object in a service </service_container/request >`.
1586
- In templates, use the :ref: `Twig global app variable <twig-app-variable >` to get
1587
- the current route and its attributes:
1588
-
1589
- .. code-block :: twig
1590
-
1591
- {% set route_name = app.current_route %}
1592
- {% set route_parameters = app.current_route_parameters %}
1584
+ In services, you can get this information by
1585
+ :doc: `injecting the RequestStack service </service_container/request >`.
1586
+ In templates, use the :ref: `Twig global app variable <twig-app-variable >`
1587
+ to get the current route name (``app.current_route ``) and its parameters
1588
+ (``app.current_route_parameters ``).
1593
1589
1594
1590
Special Routes
1595
1591
--------------
You can’t perform that action at this time.
0 commit comments