Response
class Response implements ResponseInterface (View source)
Methods
static Response
getInstance()
Get response
string|null
getContent()
Get response message
int
getCode()
Get status code
array
getHeaders()
Get headers
setContent(string $content)
Get response message
withHeaders(array $headers)
Get headers
string
download(string $file, string|null $filename = null, string $disposition = 'attachment', array $headers = [])
Download the given file as an argument
string
json(mixed $data, int $code = 200, array $headers = [])
JSON response
string
send(mixed $data, int $code = 200, array $headers = [])
Equivalent to an echo, except that it ends the application
string
render(string $template, array $data = [], int $code = 200, array $headers = [])
Make view rendering
serverAccessControl()
Get accessControl instance
void
sendContent()
No description
Details
static Response
getInstance()
Get response
string|null
getContent()
Get response message
int
getCode()
Get status code
array
getHeaders()
Get headers
Response
setContent(string $content)
Get response message
Response
withHeaders(array $headers)
Get headers
Response
addHeader(string $key, string $value)
Modify http headers
string
download(string $file, string|null $filename = null, string $disposition = 'attachment', array $headers = [])
Download the given file as an argument
Response
status(int $code)
Modify http headers
string
json(mixed $data, int $code = 200, array $headers = [])
JSON response
string
send(mixed $data, int $code = 200, array $headers = [])
Equivalent to an echo, except that it ends the application
string
render(string $template, array $data = [], int $code = 200, array $headers = [])
Make view rendering
ServerAccessControl
serverAccessControl()
Get accessControl instance
void
sendContent()
No description