Skip to content
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

Added minor clarification #6336

Closed
wants to merge 1 commit into from
Closed

Conversation

ThomasLandauer
Copy link
Contributor

It was not clear if the following code applies to BinaryFileResponse only or to all file responses.

Since the following two paragraphs ("It is possible to delete ..." and "If you just created...") also apply to BinaryFileResponse only, it would be even better to have a separate heading for BinaryFileResponse, but I don't know how to create another sub-heading at this level.

It was not clear if the following code applies to BinaryFileResponse only or to all file responses.

Since the following two paragraphs ("It is possible to delete ..." and "If you just created...") also apply to BinaryFileResponse only, it would be even better to have a separate heading for BinaryFileResponse, but I don't know how to create another sub-heading at this level.
@wouterj
Copy link
Member

wouterj commented Mar 7, 2016

👍 (it's not 100% true as headers can be set on each response type, but we document that should be easy to discover)

@ThomasLandauer
Copy link
Contributor Author

@wouterj: There's a typo in your comment, so I'm not sure about what you're saying ;-)

Anyway - my point:
If I do the following:

$response = new Response($dompdf->output());      
$response->setContentDisposition(
    ResponseHeaderBag::DISPOSITION_ATTACHMENT,
    'filename.txt'
);

I get: Fatal error: Call to undefined method Symfony\Component\HttpFoundation\Response::setContentDisposition()

...since setContentDisposition() is a method of BinaryFileResponse http://api.symfony.com/2.3/Symfony/Component/HttpFoundation/BinaryFileResponse.html but not of the "regular" Response object http://api.symfony.com/2.3/Symfony/Component/HttpFoundation/Response.html

In the original sentence in the docs ("You can still set..."), it's not clear if "still" means after $response = new BinaryFileResponse($file); or after the (implied) $response = new Response(...) of the use Symfony\Component\HttpFoundation\ResponseHeaderBag;... code sample.

@weaverryan
Copy link
Member

I like it - nice clarification. And I agree with Wouter's comments. Good PR - thanks Thomas!

@weaverryan weaverryan closed this Mar 17, 2016
weaverryan added a commit that referenced this pull request Mar 17, 2016
This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #6336).

Discussion
----------

Added minor clarification

It was not clear if the following code applies to BinaryFileResponse only or to all file responses.

Since the following two paragraphs ("It is possible to delete ..." and "If you just created...") also apply to BinaryFileResponse only, it would be even better to have a separate heading for BinaryFileResponse, but I don't know how to create another sub-heading at this level.

Commits
-------

9490b08 Added minor clarification
@ThomasLandauer ThomasLandauer deleted the patch-8 branch August 17, 2018 09:54
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.

None yet

3 participants