How Generating URLs from a template correctly in Symfony2/Twig

faommiqckgsb

New Member
I'm working with Symfony2 and:I have this in the routing.yml\[code\]_welcome: resource: "@AcmeBundle/Controller/" type: annotation\[/code\]I this method within a controller:\[code\]/** * @Route("/{page}") */public function staticAction($page){ return $this->render('AcmeBundle:Static:'.$page.'.html.twig');}\[/code\]To generate common pages:\[code\]/home/contact /privacy\[/code\]But when I make the url on the menu:\[code\]<a href="http://stackoverflow.com/questions/15857358/{{ path('_welcome', {'page': 'home'}) }}">Home</a><a href="http://stackoverflow.com/questions/15857358/{{ path('_welcome', {'page': 'contact'}) }}">Contact</a><a href="http://stackoverflow.com/questions/15857358/{{ path('_welcome', {'page': 'privacy'}) }}">Privacy</a>\[/code\]And I Symfony generates these urls:\[code\]
 
Back
Top