In twig I need to get the current full uri (url + uri ) without render it it like
path('route_test', {param1:1})
How to get it ?
You can get the current URL in Twig/Silex 2 like this: global. request. attributes. get('_route') .
Try to use :
{{ app.request.uri }}
As it was said above, some of the answers are not valid anymore.
What worked for me as of 2017'09 is this
{{ url('<current>') }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With