Skip to content

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

Merged
merged 3 commits into from
Jul 25, 2018

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Jul 24, 2018

@@ -637,6 +637,27 @@ file_link
Generates a link to the provided file and line number using
a preconfigured scheme.

file_relative
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

@yceruto yceruto Jul 24, 2018

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.

Copy link
Member Author

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.

Copy link
Member

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!

Copy link
Member

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?

@javiereguiluz
Copy link
Member

Thanks Yonel.

@javiereguiluz javiereguiluz merged commit 540817e into symfony:master Jul 25, 2018
javiereguiluz added a commit that referenced this pull request Jul 25, 2018
…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
@yceruto yceruto deleted the file_relative branch July 25, 2018 12:08
@yceruto
Copy link
Member Author

yceruto commented Jul 25, 2018

Thanks to you for the new writing, always better!

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.

4 participants