classe Response implémente ResponseInterface (Voir la source)

Méthodes

static Response
getInstance()

Get response

string
getContent()

Get response message

int
getCode()

Get status code

array
getHeaders()

Get headers

setContent(string $content)

Get response message

withHeaders(array $headers)

Get headers

addHeader(string $key, string $value)

Modify http headers

string
download(string $file, null $filename = null, string $disposition = 'attachment', array $headers = [])

Download the given file as an argument

mixed
status(int $code)

Modify http headers

string
json(mixed $data, int $code = 200, array $headers = [])

JSON response

string
send(string|array|stdClass $data, int $code = 200, array $headers = [])

Equivalent to an echo, except that it ends the application

string
render($template, array $data = [], int $code = 200, array $headers = [])

Make view rendering

AccessControl
serverAccessControl()

Get accessControl instance

string
sendContent()

Pas de description

Détails

static Response getInstance()

Get response

Valeur de retour

Response

string getContent()

Get response message

Valeur de retour

string

int getCode()

Get status code

Valeur de retour

int

array getHeaders()

Get headers

Valeur de retour

array

Response setContent(string $content)

Get response message

Paramètres

string $content

Valeur de retour

Response

Response withHeaders(array $headers)

Get headers

Paramètres

array $headers

Valeur de retour

Response

Response addHeader(string $key, string $value)

Modify http headers

Paramètres

string $key
string $value

Valeur de retour

Response

string download(string $file, null $filename = null, string $disposition = 'attachment', array $headers = [])

Download the given file as an argument

Paramètres

string $file
null $filename
string $disposition
array $headers

Valeur de retour

string

mixed status(int $code)

Modify http headers

Paramètres

int $code

Valeur de retour

mixed

string json(mixed $data, int $code = 200, array $headers = [])

JSON response

Paramètres

mixed $data
int $code
array $headers

Valeur de retour

string

string send(string|array|stdClass $data, int $code = 200, array $headers = [])

Equivalent to an echo, except that it ends the application

Paramètres

string|array|stdClass $data
int $code
array $headers

Valeur de retour

string

string render($template, array $data = [], int $code = 200, array $headers = [])

Make view rendering

Paramètres

$template
array $data
int $code
array $headers

Valeur de retour

string

Exceptions

AccessControl serverAccessControl()

Get accessControl instance

Valeur de retour

AccessControl

string sendContent()

Pas de description

Valeur de retour

string