How to get the current url in Twig in Symfony

0

I need to get the final route of the url in twig

For example I have this url:

http://www.hackeruna.com/pagina , I just need this part of the path /pagina .

    
asked by juanitourquiza 04.05.2018 в 00:42
source

1 answer

0

The way to get the current url in symfony from Twig is:

Relative url:

{{ app.request.pathinfo }}

Absolute URL:

{{ app.request.pathinfo }}

To solve my problem there is also the option:

{{ app.request.pathinfo }}
    
answered by 04.05.2018 / 00:42
source