Skip to content

Commit 99f8600

Browse files
committed
minor #8190 Minor reword to explain that path() generates absolute URLs (javiereguiluz)
This PR was merged into the 2.7 branch. Discussion ---------- Minor reword to explain that path() generates absolute URLs I propose this change as a way to avoid confusion like #8189. Commits ------- 9d34420 Minor reword to explain that path() generates absolute URLs
2 parents 341317a + 9d34420 commit 99f8600

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

routing/scheme.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,18 @@ the URI scheme via schemes:
4848
The above configuration forces the ``secure`` route to always use HTTPS.
4949

5050
When generating the ``secure`` URL, and if the current scheme is HTTP, Symfony
51-
will automatically generate an absolute URL with HTTPS as the scheme:
51+
will automatically generate an absolute URL with HTTPS as the scheme, even when
52+
using the ``path()`` function:
5253

5354
.. code-block:: twig
5455
5556
{# If the current scheme is HTTPS #}
5657
{{ path('secure') }}
57-
{# generates /secure #}
58+
{# generates a relative URL: /secure #}
5859
5960
{# If the current scheme is HTTP #}
6061
{{ path('secure') }}
61-
{# generates https://example.com/secure #}
62+
{# generates an absolute URL: https://example.com/secure #}
6263
6364
The requirement is also enforced for incoming requests. If you try to access
6465
the ``/secure`` path with HTTP, you will automatically be redirected to the

0 commit comments

Comments
 (0)