Skip to content

Commit

Permalink
minor #6009 Fix missing constant usage for generating urls (Tobion)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xabbuh committed Dec 14, 2015
2 parents 41c1641 + 2ecc541 commit 5cc78bc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5cc78bc

Please sign in to comment.