ResponseBuilder
final class ResponseBuilder (View source)
Methods
__construct(ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory)
text(string $content, int $status = 200)
ResponseInterface
html(string $content, int $status = 200)
ResponseInterface
json(array $payload, int $status = 200)
ResponseInterface
redirect(string $to, int $status = 302)
ResponseInterface
download(string $filePath, string|null $downloadName = null, string $contentType = 'application/octet-stream')
ResponseInterface
response(string $content = '', int $status = 200, string $contentType = 'text/html; charset=UTF-8')
ResponseInterface
stream(callable $producer, int $status = 200, string $contentType = 'text/plain; charset=UTF-8', array $headers = [])
ResponseInterface
Details
__construct
__construct(ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory)
No description
text
ResponseInterface
text(string $content, int $status = 200)
No description
html
ResponseInterface
html(string $content, int $status = 200)
No description
json
ResponseInterface
json(array $payload, int $status = 200)
No description
redirect
ResponseInterface
redirect(string $to, int $status = 302)
No description
download
ResponseInterface
download(string $filePath, string|null $downloadName = null, string $contentType = 'application/octet-stream')
No description
response
ResponseInterface
response(string $content = '', int $status = 200, string $contentType = 'text/html; charset=UTF-8')
No description
stream
ResponseInterface
stream(callable $producer, int $status = 200, string $contentType = 'text/plain; charset=UTF-8', array $headers = [])
No description