2
votes

Since I upgraded to Symfony 2.7, I get an error 500 on my error pages when I try to generate a route in twig:

<!-- app/Resources/TwigBundle/views/Exception/error404.html.ywig -->
<a href="{{ path( 'homepage' ) }}">Take me home</a>

The error is:

An exception has been thrown during the rendering of a template ("Unable to generate a URL for the named route "homepage" as such route does not exist.") in TwigBundle:Exception:error404.html.twig at line 47.

I can call the route from any page that is not located within the app folder. The route exists in src\Acme\AcmeBundle\Resources\config\routing.yml.

Edit:

My routing:

homepage:
   path:     /
   defaults: { _controller: SiteBundle:Site:index }
1
what about <a href="/homepage">Take me home</a>Abdulla Nilam
It works but I give up on Symfony's powerful routing module.CôteViande
whats that?? i didnt get youAbdulla Nilam
May we have a look to your routing.yml?scoolnico
@scoolnico It's up, but it is very basic. Anyway the route works in other twig files (those not in the app folder I think).CôteViande

1 Answers

2
votes

It turns out the Lunetics bundle for locale was resetting the locale in sub-requests. I disabled it and everything is fine.