class Response (View source)

Methods

static void
dispatch()

Define registered headers to response

static array
getHeaders()

Get registered headers

static int|bool
status(int $code = null, bool $trigger = true)

Get or set status code and return last status code

static void
putHeader(string $name, string $value, bool $replace = true)

Register a header and return your index, if Response::dispatch was previously executed the header will be set directly and will not be registered

static void
removeHeader(string $name)

Remove registered (or setted) header

static void
cache(int $seconds, int $modified = 0)

Set header to cache page (or no-cache)

static void
download(string $name = null, int $contentLength = 0)

Force download current page

static void
type($type)

Set content-type

static void
charset($charset)

Set charset in content-type

Details

static void dispatch()

Define registered headers to response

Return Value

void

static array getHeaders()

Get registered headers

Return Value

array

static int|bool status(int $code = null, bool $trigger = true)

Get or set status code and return last status code

Parameters

int $code
bool $trigger

Return Value

int|bool

static void putHeader(string $name, string $value, bool $replace = true)

Register a header and return your index, if Response::dispatch was previously executed the header will be set directly and will not be registered

Parameters

string $name
string $value
bool $replace

Return Value

void

static void removeHeader(string $name)

Remove registered (or setted) header

Parameters

string $name

Return Value

void

static void cache(int $seconds, int $modified = 0)

Set header to cache page (or no-cache)

Parameters

int $seconds
int $modified

Return Value

void

static void download(string $name = null, int $contentLength = 0)

Force download current page

Parameters

string $name
int $contentLength

Return Value

void

static void type($type)

Set content-type

Parameters

$type

Return Value

void

static void charset($charset)

Set charset in content-type

Parameters

$charset

Return Value

void