简体   繁体   中英

how can I return to the previous page in twig?

I want to know how to return to the previous page using a twig template no javascript, if it's possible.

Any help would be great.

In twig you can access:

app.request.headers.get('referer')

Hope this help

如果你需要相同的路线使用

<a href="{{ path(app.request.get('_route')) }}">Same page</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM