Permalink
Browse files

minor #3732 Update routing.rst. Explain using url() v. path(). (acker…

…man)

This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes #3732).

Discussion
----------

Update routing.rst. Explain using url() v. path().

The original documentation seemed to imply that, when generating absolute URLs from a template, the argument TRUE should be supplied to the url() method. This change explains that in Twig, one uses the url() method to generate an absolute URL.

Commits
-------

6eac303 Update routing.rst. Explain using url() v. path().
  • Loading branch information...
weaverryan committed Apr 2, 2014
2 parents 44c6273 + 1dd9b75 commit 4d0ff8f8762ea7d8e19b04c21065269e3b4667ab
Showing with 3 additions and 1 deletion.
  1. +3 −1 book/routing.rst
View
@@ -1240,7 +1240,9 @@ method::
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
// http://www.example.com/blog/my-blog-post
From a template, it looks like this:
From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL)
rather than the ``path()`` function (which generates a relative URL). In PHP, pass ``true``
to ``generateUrl()``:
.. configuration-block::

0 comments on commit 4d0ff8f

Please sign in to comment.