Class HttpResponse (namespace Nette\Web)
HttpResponse class.
Object | --HttpResponse
Implements interfaces:
Public Method Summary | |
---|---|
void |
__destruct
()
|
void |
addHeader
(string $name, string $value)
Adds HTTP header.
|
static string |
date
([int $time =
NULL ])
Returns HTTP valid date format.
|
void |
Deletes a cookie.
|
bool |
Enables compression. (warning: may not work)
|
void |
expire
(mixed $seconds)
Sets the number of seconds before a page cached on a browser expires.
|
int |
getCode
()
Returns HTTP response code.
|
mixed |
getHeader
(string $header, [mixed $default =
NULL ])
Return the value of the HTTP header.
|
array |
getHeaders
()
Returns a list of headers to sent.
|
bool |
isSent
()
Checks if headers have been sent.
|
void |
redirect
(string $url, [int $code =
self::S302_FOUND ])
Redirects to a new URL. Note: call exit() after it.
|
HttpResponse |
setCode
(int $code)
Sets HTTP response code.
|
HttpResponse |
setContentType
(string $type, [string $charset =
NULL ])
Sends a Content-type HTTP header.
|
HttpResponse |
setCookie
(string $name, string $value, mixed $expire, [string $path =
NULL ], [string $domain = NULL ], [bool $secure = NULL ])
Sends a cookie.
|
HttpResponse |
setHeader
(string $name, string $value)
Sends a HTTP header and replaces a previous one.
|
Methods Inherited From Object |
---|
extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset() |
Variable Summary | ||||
---|---|---|---|---|
string | $cookieDomain | '' |
line 45 The domain in which the cookie will be available |
|
string | $cookiePath | '/' |
line 48 The path in which the cookie will be available |
|
string | $cookieSecure | FALSE |
line 51 The path in which the cookie will be available |
Method Details | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
line 298 __destructpublic void __destruct ()
|
|||||||||||||||||||||||||||||||||
line 133 addHeaderpublic void addHeader (string $name, string $value) Adds HTTP header. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 259 datepublic static string date ([int $time = Returns HTTP valid date format.
|
|||||||||||||||||||||||||||||||||
line 360 deleteCookiepublic void deleteCookie (string $name, [string $path = Deletes a cookie. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 270 enableCompressionpublic bool enableCompression () Enables compression. (warning: may not work)
|
|||||||||||||||||||||||||||||||||
line 186 expirepublic void expire (mixed $seconds) Sets the number of seconds before a page cached on a browser expires. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 96 getCodepublic int getCode () Returns HTTP response code. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 224 getHeaderpublic mixed getHeader (string $header, [mixed $default = Return the value of the HTTP header.
|
|||||||||||||||||||||||||||||||||
line 242 getHeaderspublic array getHeaders () Returns a list of headers to sent. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 211 isSentpublic bool isSent () Checks if headers have been sent. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 166 redirectpublic void redirect (string $url, [int $code = Redirects to a new URL. Note: call exit() after it. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 65 setCodepublic HttpResponse setCode (int $code) Sets HTTP response code. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 151 setContentTypepublic HttpResponse setContentType (string $type, [string $charset = Sends a Content-type HTTP header. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 324 setCookiepublic HttpResponse setCookie (string $name, string $value, mixed $expire, [string $path = Sends a cookie. Implementation of:
|
|||||||||||||||||||||||||||||||||
line 110 setHeaderpublic HttpResponse setHeader (string $name, string $value) Sends a HTTP header and replaces a previous one. Implementation of:
|