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() function can also be used if needed.
| Methods | ||
|---|---|---|
public
|
__construct(callable $callback = null, int $status = 200, array $headers = [])
|
# |
public
|
setCallback(callable $callback): $this
|
# |
public
|
getCallback(): ?Closure
|
# |
public
|
sendHeaders(): $this
|
# |
public
|
sendContent(): $this
|
# |
public
|
setContent(?string $content): $this
|
# |
public
|
getContent(): string|false
|
# |
| Properties | |||
|---|---|---|---|
protected
|
|
$callback
|
# |
protected
|
|
$streamed
|
# |
private
|
bool
|
$headersSent
|
# |
| Properties inherited from Symfony\Component\HttpFoundation\Response |
|---|
$headers, $content, $version, $statusCode, $statusText, $charset, $statusTexts, $sentHeaders |