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 6eac303

Browse filesBrowse files
committed
Update routing.rst. Explain using url() v. path().
1 parent 78425c6 commit 6eac303
Copy full SHA for 6eac303

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
@@ -1330,7 +1330,9 @@ method::
13301330
$this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true);
13311331
// http://www.example.com/blog/my-blog-post
13321332

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

13351337
.. configuration-block::
13361338

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.