Response
class Response implements ResponseInterface (View source)
Methods
Get response
Get status code
Download the given file as an argument
Add http headers
Add http header
Set cookie header
Set multiple cookies
Get headers
Get response message
Get response message
Equivalent to an echo, except that it ends the application
JSON response
Make view rendering
Modify the service access control from ServerAccessControl instance
No description
Details
static Response
getInstance()
Get response
int
getCode()
Get status code
string
download(string $file, string|null $filename = null, array $headers = [])
Download the given file as an argument
Response
withHeaders(array $headers)
Add http headers
Response
withHeader(string $key, string $value)
Add http header
Response
withCookie(string $key, string $value)
Set cookie header
Response
withCookies(array $cookies)
Set multiple cookies
array
getHeaders()
Get headers
string|null
getContent()
Get response message
Response
setContent(string $content)
Get response message
Response
status(int $code)
Modify http headers
string
send(mixed $data, int $code = 200, array $headers = [])
Equivalent to an echo, except that it ends the application
string
json(mixed $data, int $code = 200, array $headers = [])
JSON response
string
render(string $template, array $data = [], int $code = 200, array $headers = [])
Make view rendering
ServerAccessControl
getServerAccessControl()
Modify the service access control from ServerAccessControl instance
void
sendContent()
No description