__construct($destroyGlobals = true)
When you create an instance of this class, it will consume the
$_GET
,
$_POST
,
$_REQUEST
,
$_FILES
and
$_COOKIES
data and pull them into the object. By default, it will also replace the data in these globals with empty arrays so that rogue code can't manipulate them.
cookie($name = null, $default = null)
If
$name
is set, will return the value of the cookie with the matching name. If there is no cookie, returns
$default
. If
$name
is not set, returns an array of all cookies.
file($name = null)
Returns the information for a given file if
$name
is set. If there is no file with that name, this function returns
null
. If
$name
is not set, returns an array of all uploaded files.
get($name = null, $default = null)
If
$name
is set, will return the value of the GET parameter with the
matching name. If there is no GET parameter, returns
$default
. If
$name
is
not set, returns an array of all cookies.
isGet()
Returns
true
if the request is a GET request.
False
is returned otherwise.
isPost()
Returns
true
if the request is a POST request.
False
is returned otherwise.
method()
Returns the request method as a string. This could be GET, POST, HEAD, PUT or DELETE, depending on what is supported by your web server and how the request was made.
post($name = null, $default = null)
If
$name
is set, will return the value of the POST parameter with the
matching name. If there is no POST parameter, returns
$default
. If
$name
is
not set, returns an array of all cookies.
request($name = null, $default = null)
If
$name
is set, will return the value of the GET parameter, POST data or cookie value (in that order) with the
matching name. If none of those exist, returns
$default
. If
$name
is
not set, returns an array of all GET parameters, POST data and cookie values. If two or more have the same name, prefer them in the order listed.