public
HttpResponse
|
#
setCode(
int
$code
)
Sets HTTP response code. Sets HTTP response code. Parameters$code intReturnsHttpResponse provides a fluent interface
Throws
InvalidArgumentException if code is invalid
InvalidStateException if HTTP headers have been sent Implementation of |
public
int
|
#
getCode(
)
Returns HTTP response code. |
public
HttpResponse
|
#
setHeader(
string
$name,
string
$value
)
Sends a HTTP header and replaces a previous one. Sends a HTTP header and replaces a previous one. Parameters$name string header name$value string header valueReturnsHttpResponse provides a fluent interface
Throws
InvalidStateException if HTTP headers have been sent
Implementation of |
public
void
|
#
addHeader(
string
$name,
string
$value
)
Adds HTTP header. Adds HTTP header. Parameters$name string header name$value string header valueThrows
InvalidStateException if HTTP headers have been sent
Implementation of |
public
HttpResponse
|
#
setContentType(
string
$type,
string
$charset = NULL
)
Sends a Content-type HTTP header. Sends a Content-type HTTP header. Parameters$type string mime-type$charset string charsetReturnsHttpResponse provides a fluent interface
Throws
InvalidStateException if HTTP headers have been sent
Implementation of |
public
void
|
#
redirect(
string
$url,
int
$code = 302
)
Redirects to a new URL. Note: call exit() after it. Redirects to a new URL. Note: call exit() after it. Parameters$url string URL$code int HTTP codeThrows
InvalidStateException if HTTP headers have been sent
Implementation of |
public
HttpResponse
|
#
setExpiration(
string|int|DateTime
$time
)
Sets the number of seconds before a page cached on a browser expires. Sets the number of seconds before a page cached on a browser expires. Parameters$time string|int|DateTime time, value 0 means "until the browser is closed"ReturnsHttpResponse provides a fluent interface
Throws
InvalidStateException if HTTP headers have been sent
Implementation of |
public
bool
|
#
isSent(
)
Checks if headers have been sent. |
public
mixed
|
#
getHeader(
string
$header,
mixed
$default = NULL
)
Return the value of the HTTP header. Return the value of the HTTP header. Parameters$header string$default mixed |
public
array
|
#
getHeaders(
)
Returns a list of headers to sent. |
public static
string
|
#
date(
string|int|DateTime
$time = NULL
)
Returns HTTP valid date format. Returns HTTP valid date format. Parameters$time string|int|DateTime |
public
void
|
#
__destruct(
)
|
public
HttpResponse
|
#
setCookie(
string
$name,
string
$value,
string|int|DateTime
$time,
string
$path = NULL,
string
$domain = NULL,
bool
$secure = NULL,
bool
$httpOnly = NULL
)
Sends a cookie. Sends a cookie. Parameters$name string name of the cookie$value string value$time string|int|DateTime expiration time, value 0 means "until the browser is closed"$path string$domain string$secure bool$httpOnly boolReturnsHttpResponse provides a fluent interface
Throws
InvalidStateException if HTTP headers have been sent
Implementation of |
public
void
|
#
deleteCookie(
string
$name,
string
$path = NULL,
string
$domain = NULL,
bool
$secure = NULL
)
Deletes a cookie. Deletes a cookie. Parameters$name string name of the cookie.$path string$domain string$secure boolThrows
InvalidStateException if HTTP headers have been sent
Implementation of |
Methods Inherited From Object
getReflection(), __call(), __callStatic(), extensionMethod(), __get(), __set(), __isset(), __unset()
PERMANENT |
2116333333 # |
BROWSER |
0 # |
S200_OK |
200 # |
S204_NO_CONTENT |
204 # |
S300_MULTIPLE_CHOICES |
300 # |
S301_MOVED_PERMANENTLY |
301 # |
S302_FOUND |
302 # |
S303_SEE_OTHER |
303 # |
S303_POST_GET |
303 # |
S304_NOT_MODIFIED |
304 # |
S307_TEMPORARY_REDIRECT |
307 # |
S400_BAD_REQUEST |
400 # |
S401_UNAUTHORIZED |
401 # |
S403_FORBIDDEN |
403 # |
S404_NOT_FOUND |
404 # |
S405_METHOD_NOT_ALLOWED |
405 # |
S410_GONE |
410 # |
S500_INTERNAL_SERVER_ERROR |
500 # |
S501_NOT_IMPLEMENTED |
501 # |
S503_SERVICE_UNAVAILABLE |
503 # |
string
|
$cookieDomain | '' |
The domain in which the cookie will be available # |
string
|
$cookiePath | '/' |
The path in which the cookie will be available # |
string
|
$cookieSecure | false |
Whether the cookie is available only through HTTPS # |
string
|
$cookieHttpOnly | true |
Whether the cookie is hidden from client-side # |