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
(int $time)
Sets the number of seconds before a page cached on a browser expires.
|
| int |
getCode
()
Returns HTTP response code.
|
| 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.
|
| bool |
setCode
(int $code)
Sets HTTP response code.
|
| void |
setContentType
(string $type, [string $charset =
NULL])
Sends a Content-type HTTP header.
|
| void |
setCookie
(string $name, string $value, int $expire, [string $path =
NULL], [string $domain = NULL], [bool $secure = NULL])
Sends a cookie.
|
| void |
setHeader
(string $name, string $value, [$replace =
TRUE])
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 42 The domain in which the cookie will be available |
|
| string | $cookiePath | '' |
line 45 The path in which the cookie will be available |
|
| string | $cookieSecure | FALSE |
line 48 The path in which the cookie will be available |
|
| Method Details | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 260 __destructpublic void __destruct ()
|
|||||||||||||||||||||||||||||||||
|
line 125 addHeaderpublic void addHeader (string $name, string $value) Adds HTTP header. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 222 datepublic static string date ([int $time = Returns HTTP valid date format.
|
|||||||||||||||||||||||||||||||||
|
line 315 deleteCookiepublic void deleteCookie (string $name, [string $path = Deletes a cookie. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 233 enableCompressionpublic bool enableCompression () Enables compression. (warning: may not work)
|
|||||||||||||||||||||||||||||||||
|
line 173 expirepublic void expire (int $time) Sets the number of seconds before a page cached on a browser expires. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 93 getCodepublic int getCode () Returns HTTP response code. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 205 getHeaderspublic array getHeaders () Returns a list of headers to sent. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 194 isSentpublic bool isSent () Checks if headers have been sent. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 157 redirectpublic void redirect (string $url, [int $code = Redirects to a new URL. Note: call exit() after it. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 62 setCodepublic bool setCode (int $code) Sets HTTP response code. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 143 setContentTypepublic void setContentType (string $type, [string $charset = Sends a Content-type HTTP header. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 287 setCookiepublic void setCookie (string $name, string $value, int $expire, [string $path = Sends a cookie. Implementation of:
|
|||||||||||||||||||||||||||||||||
|
line 107 setHeaderpublic void setHeader (string $name, string $value, [$replace = Sends a HTTP header and replaces a previous one. Implementation of:
|
|||||||||||||||||||||||||||||||||
