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

Add documentation for the new BinaryFileResponse class (#1866) #2416

Merged
merged 3 commits into from Apr 4, 2013

Conversation

Projects
None yet
4 participants
@jbafford
Copy link
Contributor

jbafford commented Mar 30, 2013

Q A
Doc fix? yes
New docs? yes (symfony/symfony#4546)
Applies to 2.2
Fixed tickets #1866
There is also a special :class:`Symfony\\Component\\HttpFoundation\\JsonResponse`
class that helps return JSON responses. See :ref:`component-http-foundation-json-response`.
There are also special classes to make certain kinds of responses easier:
- For JSON, there is :class:`Symfony\\Component\\HttpFoundation\\JsonResponse`.

This comment has been minimized.

@wouterj

wouterj Mar 30, 2013

Member

please add an empty line before this one

Downloading Files
.. _component-http-foundation-serving-files:

Serving Files
~~~~~~~~~~~~~~~~~

This comment has been minimized.

@wouterj

wouterj Mar 30, 2013

Member

a couple ~ to much here

@@ -424,6 +426,26 @@ abstracts the hard work behind a simple API::

$response->headers->set('Content-Disposition', $d);

.. versionadded:: 2.2
The :class:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse` class was added in Symfony 2.2.

This comment has been minimized.

@wouterj

wouterj Mar 30, 2013

Member

You should break the line after the first word crossing the 72 character

$file = 'path/to/file.txt';
$response = new BinaryFileResponse($file);

The :class:`Symfony\\Component\\HttpFoundation\\BinaryFileResponse` will

This comment has been minimized.

@wouterj

wouterj Mar 30, 2013

Member

There is no need to add 2 API links to the same page. I prefer to use the normal BinaryFileResponse inline code block here


- For JSON, there is :class:`Symfony\\Component\\HttpFoundation\\JsonResponse`.
See :ref:`component-http-foundation-json-response`.
- For files, there is :class:`Symfony\\Component\\HttpFoundation\\JsonResponse`.

This comment has been minimized.

@michaelperrin

michaelperrin Mar 31, 2013

Contributor

A little typo here: I think you meant Symfony\\Component\\HttpFoundation\\BinaryFileResponse

This comment has been minimized.

@jbafford

jbafford Mar 31, 2013

Contributor

You're correct. I have that fixed now.

weaverryan added a commit that referenced this pull request Apr 4, 2013

Merge pull request #2416 from jbafford/i1866
Add documentation for the new BinaryFileResponse class (#1866)

@weaverryan weaverryan merged commit 4140805 into symfony:2.2 Apr 4, 2013

@weaverryan

This comment has been minimized.

Copy link
Member

weaverryan commented Apr 4, 2013

Hey John!

This is really great - and I get to learn about a new feature from your work ;). I've only made a few small changes and also mentioned X-Sendfile at sha: 615a7b3. If you see any issues, let me know!

Thanks!

@jbafford

This comment has been minimized.

Copy link
Contributor

jbafford commented Apr 4, 2013

Glad to be of help! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment