From 2ecc541e09c09e70332d665033e20e3b717c9d3a Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Sun, 13 Dec 2015 17:43:15 +0100 Subject: [PATCH] Fix missing constant usage for generating urls --- book/routing.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)