I\'m working with Symfony2 and:
I have this in the routing.yml
_welcome: resource: \"@AcmeBundle/Controller/\" type: annotation
You've to add a route name in your controller route annotations as follow,
/** * @Route("/{page}", name="static") */ public function staticAction($page) { // ... }
You could then call the twig path helper using that name,
path
<a href="{{ path('static', {'page': 'home'}) }}">Home</a>