Skip to content

Commit 1dd9b75

Browse files
ackermanweaverryan
authored andcommitted
Update routing.rst. Explain using url() v. path().
1 parent 44c6273 commit 1dd9b75

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

book/routing.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,9 @@ method::
12401240
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
12411241
// http://www.example.com/blog/my-blog-post
12421242

1243-
From a template, it looks like this:
1243+
From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL)
1244+
rather than the ``path()`` function (which generates a relative URL). In PHP, pass ``true``
1245+
to ``generateUrl()``:
12441246

12451247
.. configuration-block::
12461248

0 commit comments

Comments
 (0)