view raw
lgomezma lgomezma - 8 months ago 247
Twig Question

Create a link with an anchor with Twig path function in Symfony 2

I'm trying to create a link with an anchor like "" in my Twig template. So far I've been using the path function to create links

. I have tried with
but obviously it doesn't work.

It doesn't seem to be a lot of information about this function or it's just that I can't find it. Any idea about how could I do it?



Try <a href="{{ path('_welcome') }}#home">Home</a>