Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4d0ff8f

Browse filesBrowse files
committed
minor #3732 Update routing.rst. Explain using url() v. path(). (ackerman)
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().
2 parents 44c6273 + 1dd9b75 commit 4d0ff8f
Copy full SHA for 4d0ff8f

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎book/routing.rst

Copy file name to clipboardExpand all lines: book/routing.rst
+3-1Lines changed: 3 additions & 1 deletion
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.