class Response extends Object implements IResponse

HttpResponse class.

Properties

string $cookieDomain
string $cookiePath
string $cookieSecure
string $cookieHttpOnly
bool $warnOnBuffer

Methods

__construct()

No description

void
setCode($code)

Sets HTTP response code.

int
getCode()

Returns HTTP response code.

void
setHeader($name, $value)

Sends a HTTP header and replaces a previous one.

void
addHeader($name, $value)

Adds HTTP header.

void
setContentType($type, $charset = NULL)

Sends a Content-type HTTP header.

void
redirect($url, $code = self::S302_FOUND)

Redirects to a new URL. Note: call exit() after it.

void
setExpiration($time)

Sets the number of seconds before a page cached on a browser expires.

bool
isSent()

Checks if headers have been sent.

mixed
getHeader($header, $default = NULL)

Returns value of an HTTP header.

array
getHeaders()

Returns a list of headers to sent.

static 
date($time = NULL) deprecated

No description

void
__destruct()

No description

void
setCookie($name, $value, $time, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL)

Sends a cookie.

void
deleteCookie($name, $path = NULL, $domain = NULL, $secure = NULL)

Deletes a cookie.

removeDuplicateCookies()

No description

Details

at line 41
__construct()

No description

at line 63
void setCode($code)

Sets HTTP response code.

Parameters

$code

Return Value

void

Exceptions

InvalidArgumentException
InvalidStateException

at line 85
int getCode()

Returns HTTP response code.

Return Value

int

at line 98
void setHeader($name, $value)

Sends a HTTP header and replaces a previous one.

Parameters

$name
$value

Return Value

void

Exceptions

InvalidStateException

at line 119
void addHeader($name, $value)

Adds HTTP header.

Parameters

$name
$value

Return Value

void

Exceptions

InvalidStateException

at line 134
void setContentType($type, $charset = NULL)

Sends a Content-type HTTP header.

Parameters

$type
$charset

Return Value

void

Exceptions

InvalidStateException

at line 148
void redirect($url, $code = self::S302_FOUND)

Redirects to a new URL. Note: call exit() after it.

Parameters

$url
$code

Return Value

void

Exceptions

InvalidStateException

at line 165
void setExpiration($time)

Sets the number of seconds before a page cached on a browser expires.

Parameters

$time

Return Value

void

Exceptions

InvalidStateException

at line 185
bool isSent()

Checks if headers have been sent.

Return Value

bool

at line 197
mixed getHeader($header, $default = NULL)

Returns value of an HTTP header.

Parameters

$header
$default

Return Value

mixed

at line 214
array getHeaders()

Returns a list of headers to sent.

Return Value

array

(name => value)

at line 228
static date($time = NULL) deprecated

deprecated

No description

Parameters

$time

at line 237
void __destruct()

No description

Return Value

void

at line 261
void setCookie($name, $value, $time, $path = NULL, $domain = NULL, $secure = NULL, $httpOnly = NULL)

Sends a cookie.

Parameters

$name
$value
$time
$path
$domain
$secure
$httpOnly

Return Value

void

Exceptions

InvalidStateException

at line 287
void deleteCookie($name, $path = NULL, $domain = NULL, $secure = NULL)

Deletes a cookie.

Parameters

$name
$path
$domain
$secure

Return Value

void

Exceptions

InvalidStateException

at line 294
removeDuplicateCookies()

internal  @deprecated
 

No description