diff --git a/book/routing.rst b/book/routing.rst index 6b95b545d61..b5054686975 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -1479,7 +1479,9 @@ By default, the router will generate relative URLs (e.g. ``/blog``). From a controller, simply pass ``true`` to the third argument of the ``generateUrl()`` method:: - $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true); + use Symfony\Component\Routing\Generator\UrlGeneratorInterface; + + $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL); // http://www.example.com/blog/my-blog-post From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL)