classe Response implémente ResponseInterface (Voir la source)

Méthodes

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

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

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()

Get accessControl instance

void
sendContent()

Pas de description

Détails

static Response getInstance()

Get response

Valeur de retour

Response

string|null getContent()

Get response message

Valeur de retour

string|null

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, string|null $filename = null, string $disposition = 'attachment', array $headers = [])

Download the given file as an argument

Paramètres

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

Valeur de retour

string

Response status(int $code)

Modify http headers

Paramètres

int $code

Valeur de retour

Response

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(mixed $data, int $code = 200, array $headers = [])

Equivalent to an echo, except that it ends the application

Paramètres

mixed $data
int $code
array $headers

Valeur de retour

string

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

Make view rendering

Paramètres

string $template
array $data
int $code
array $headers

Valeur de retour

string

Exceptions

ServerAccessControl serverAccessControl()

Get accessControl instance

Valeur de retour

ServerAccessControl

void sendContent()

Pas de description

Valeur de retour

void