-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Added docs for file helper #6454
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
dfridrich
commented
Apr 10, 2016
Q | A |
---|---|
Doc fix? | no |
New docs? | yes symfony/symfony#18502 |
Applies to | 3.1 |
Fixed tickets |
LGTM 👍 |
@OskarStark it can't be as the feature has not yet been merged (and there still is some discussion on the implementation). |
Oh sorry @wouterj , i meant the current status looks good ;-) |
…rich) This PR was squashed before being merged into the 3.2-dev branch (closes #18502). Discussion ---------- [FrameworkBundle] Add file helper to Controller | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#6454 I think it would be more "sexy" to serve files from controller easier (like `json()` helper does). **This Controller helper allows user to serve files to Response in these ways:** * pass `Symfony\Component\HttpFoundation\File` (or `Symfony\Component\HttpFoundation\UploadedFile`) instance * [REMOVED] provide content as `string` and specify file name (mime type will be auto recognized) * provide path to file (you are still able to specify other than original file name) **Examples** return $this->file($uploadedFile); // ...or... return $this->file('/path/to/my/picture.jpg'); Commits ------- d9a8499 [FrameworkBundle] Add file helper to Controller
…rich) This PR was squashed before being merged into the 3.2-dev branch (closes #18502). Discussion ---------- [FrameworkBundle] Add file helper to Controller | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | symfony/symfony-docs#6454 I think it would be more "sexy" to serve files from controller easier (like `json()` helper does). **This Controller helper allows user to serve files to Response in these ways:** * pass `Symfony\Component\HttpFoundation\File` (or `Symfony\Component\HttpFoundation\UploadedFile`) instance * [REMOVED] provide content as `string` and specify file name (mime type will be auto recognized) * provide path to file (you are still able to specify other than original file name) **Examples** return $this->file($uploadedFile); // ...or... return $this->file('/path/to/my/picture.jpg'); Commits ------- d9a8499 [FrameworkBundle] Add file helper to Controller
File helper | ||
~~~~~~~~~~~ | ||
|
||
If you want to serve file use |
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.
[...] use the [...]
Hi @dfridrich. I've rebased your PR and tweaked the wording a bit (so we can remove most of the paragraph and use the code examples more) in #6732. I've kept your commit, so you'll still get the credits you deserve. Thanks! |