-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Clarify documentation on serving files #6613
Conversation
👍 status: reviewed |
@@ -483,6 +483,9 @@ abstracts the hard work behind a simple API:: | |||
|
|||
$response->headers->set('Content-Disposition', $d); | |||
|
|||
You can add the file's content as usual, for example by using |
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.
Instead of You can add the file's content as usual...
maybe we should say Then you must include the file's content as usual...
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.
Being a non-native speaker, I'm really not sure which one is better here. :)
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.
@raphaelm setting aside the grammar/wording issues ... the problem I see with the original text is that it says: "well, if you want, include the file contents". But it should say something like: "don't forget that it's mandatory to include the content files and you must do that manually; otherwise, the file is not really sent".
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.
Alright, I adjusted that.
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'm actually wondering why we don't set the content as the constructor argument, as done most of the time when setting response content?
👍 |
For a beginner, the "Serving Files" documentation was a little bit ambiguous on whether the makeDisposition method only adds the header or deals with sending the content as well. This change tries to make that explicit.
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #6613). Discussion ---------- Clarify documentation on serving files For a beginner, the "Serving Files" documentation was a little bit ambiguous on whether the makeDisposition method only adds the header or deals with sending the content as well. This change tries to make that explicit. Commits ------- 7746e07 Clarify documentation on serving files
Thanks @raphaelm! I've merged this into the 2.7 version of the docs with 16bf6db. Afterwards, I decided to remove the sentence you've added and instead add the missing code lines in the example. I think it's easier to read and understand. You can see these changes in 4fe59bb. Feel free to comment if you don't agree. Thanks again for pointing us at this confusing spot in the docs. I hope to see more of these clearifying improvements! :) |
Hi @wouterj, I think that your version is even better. Thank you as well! :) |
For a beginner, the "Serving Files" documentation was a little bit ambiguous on whether the makeDisposition method only adds the header or deals with sending the content as well. This change tries to make that explicit.