Skip to content

Change twig function path() to url(). #8189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Change twig function path() to url(). #8189

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Jul 18, 2017

url() (not path()) generates absolute URL.

url() (not path()) generates absolute URL.
@javiereguiluz
Copy link
Member

@zephyr-thomas thanks for your first contribution to Symfony Docs 🎉

Sadly, I think there's been a misunderstanding. The article tries to explain that if you force HTTPS, the value generated by path() can be a relative or an absolute URL. If you already are in a HTTPS page, then path() generates a relative URL. But if you are in a HTTP page, it generates an absolute URL because it's the only way to change the scheme to HTTPS.

I know it's a bit confusing that path() generates absolute URLs sometimes, but I think it's acceptable for cases like this one.

@ghost
Copy link
Author

ghost commented Jul 18, 2017

Thanks for explaining. :)
I was a bit confused with the absolute url from path(). :/

@javiereguiluz
Copy link
Member

@zephyr-thomas thanks to your pull request, I realized that this may be confusing. In #8190 I'm proposing some minor changes to try to avoid some confusion.

xabbuh added a commit that referenced this pull request Jul 21, 2017
…Ls (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
@ghost ghost deleted the patch-1 branch August 16, 2017 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants