Skip to content

Commit 5cc78bc

Browse files
committed
minor #6009 Fix missing constant usage for generating urls (Tobion)
This PR was merged into the 2.3 branch. Discussion ---------- Fix missing constant usage for generating urls This was forgotten in #5813 as reported in symfony/symfony#16991 Commits ------- 2ecc541 Fix missing constant usage for generating urls
2 parents 41c1641 + 2ecc541 commit 5cc78bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

book/routing.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1479,7 +1479,9 @@ By default, the router will generate relative URLs (e.g. ``/blog``). From
14791479
a controller, simply pass ``true`` to the third argument of the ``generateUrl()``
14801480
method::
14811481

1482-
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
1482+
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
1483+
1484+
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
14831485
// http://www.example.com/blog/my-blog-post
14841486

14851487
From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL)

0 commit comments

Comments
 (0)