I want to generate a Url directly in my controller. I want to user a url defined in my routing.yml file that needs a parameter.
I\'ve found that code in the Cookbook (Ro
Get the router from the container.
$router = $this->get('router');
Then use the router to generate the Url
$uri = $router->generate('blog_show', array('slug' => 'my-blog-post'));