-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add file_relative function to the Twig reference #10115
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
Conversation
@@ -637,6 +637,27 @@ file_link | |||
Generates a link to the provided file and line number using | |||
a preconfigured scheme. | |||
|
|||
file_relative |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excuse me for the nitpicking ... but wouldn't |relative_path
be a better name than |file_relative
for this filter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, but that one already exists for urls.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least it is consistent with |file_link
filter. Maybe should be |file_relative_path
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant, even if there is no name conflict between functions and filters, it could be confusing to have two helpers with the same name and different goals.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Let's keep this name then. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about relative_file_path
instead?
Thanks Yonel. |
…o, javiereguiluz) This PR was merged into the master branch. Discussion ---------- Add file_relative function to the Twig reference Documenting https://github.com/symfony/symfony/pull/27978/files#diff-f1a4cceb03e213bc53ab3f0ed53b7da5R215 Commits ------- 540817e Final reword 67460dc Reword and added the versionadded directive 3eec2ce Document file_relative Twig function
Thanks to you for the new writing, always better! |
Documenting https://github.com/symfony/symfony/pull/27978/files#diff-f1a4cceb03e213bc53ab3f0ed53b7da5R215