Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
dfridrich commentedApr 10, 2016
| Q | A |
|---|---|
| Doc fix? | no |
| New docs? | yessymfony/symfony#18502 |
| Applies to | 3.1 |
| Fixed tickets |
OskarStark commentedApr 29, 2016
LGTM 👍 |
wouterj commentedMay 5, 2016
@OskarStark it can't be as the feature has not yet been merged (and there still is some discussion on the implementation). |
OskarStark commentedMay 6, 2016
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#6454I 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#6454I 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
book/controller.rst Outdated
| 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 [...]
wouterj commentedJul 8, 2016
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! |