class StreamedResponse extends Response
StreamedResponse represents a streamed HTTP response.
A StreamedResponse uses a callback for its content.
The callback should use the standard PHP functions like echo to stream the response back to the client. The flush() method can also be used if needed.
| __construct(callable $callback = null, int $status = 200, array $headers = array()) | ||
| static StreamedResponse | create(callable|null $callback = null, int $status = 200, array $headers = array()) Factory method for chainability. | |
| $this | setCallback(callable $callback) Sets the PHP callback associated with this Response. | |
| $this | sendHeaders() {@inheritdoc} | |
| $this | sendContent() {@inheritdoc} | |
| $this | setContent($content) {@inheritdoc} | |
| false | getContent() {@inheritdoc} |
| callable | $callback | A valid PHP callback or null to set it later |
| int | $status | The response status code |
| array | $headers | An array of response headers |
Factory method for chainability.
| callable|null | $callback | A valid PHP callback or null to set it later |
| int | $status | The response status code |
| array | $headers | An array of response headers |
| StreamedResponse |
Sets the PHP callback associated with this Response.
| callable | $callback | A valid PHP callback |
| $this |
{@inheritdoc}
This method only sends the headers once.
| $this |
{@inheritdoc}
This method only sends the content once.
| $this |
{@inheritdoc}
| $content |
| $this |
| LogicException | when the content is not null |
{@inheritdoc}
| false |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/HttpFoundation/StreamedResponse.html