Skip to content

Commit

Permalink
minor symfony#3732 Update routing.rst. Explain using url() v. path().…
Browse files Browse the repository at this point in the history
… (ackerman)

This PR was submitted for the 2.4 branch but it was merged into the 2.3 branch instead (closes symfony#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 4d0ff8f
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 @@ -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::

Expand Down

0 comments on commit 4d0ff8f

Please sign in to comment.