Http Request utilities.
More...
|
static | setValuesToObject ($object, $values=null) |
| Affects member to member the values of the associative array $values to the members of the object $object Used for example to retrieve the variables posted and assign them to the members of an object. More...
|
|
static | setGetValuesToObject ($object) |
| Affects member to member the values of $_GET to the members of the object $object $object must have accessors to each members. More...
|
|
static | setPostValuesToObject ($object) |
| Affects member to member the values of $_POST to the members of the object $object $object must have accessors to each members. More...
|
|
static | getPost ($function="htmlentities") |
| Call a cleaning function on the post. More...
|
|
static | getInput () |
| Returns the query data, for PUT, DELETE PATCH methods. More...
|
|
static | getDatas () |
| Returns the query data, regardless of the method. More...
|
|
static | getContentType () |
| Returns the request content-type header. More...
|
|
static | isAjax () |
| Returns true if the request is an Ajax request. More...
|
|
static | isPost () |
| Returns true if the request is sent by the POST method. More...
|
|
static | isCrossSite () |
| Returns true if the request is cross site. More...
|
|
static | isJSON () |
| Returns true if request contentType is set to json. More...
|
|
static | get ($key, $default=NULL) |
| Returns the value of the $key variable passed by the get method or $default if the $key variable does not exist. More...
|
|
static | post ($key, $default=NULL) |
| Returns the value of the $key variable passed by the post method or $default if the $key variable does not exist. More...
|
|
static | getUrl ($url) |
|
static | getUrlParts () |
|
static | getMethod () |
| Returns the http method. More...
|
|
static | cleanUrl ($url) |
|
Http Request utilities.
- Author
- jc
- Version
- 1.0.0.2
Definition at line 13 of file URequest.php.
◆ cleanUrl()
◆ get()
static get |
( |
|
$key, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Returns the value of the $key variable passed by the get method or $default if the $key variable does not exist.
- Parameters
-
string | $key | |
string | $default | return value by default |
- Returns
- string
Definition at line 136 of file URequest.php.
◆ getContentType()
static getContentType |
( |
| ) |
|
|
static |
Returns the request content-type header.
- Returns
- string
Definition at line 89 of file URequest.php.
◆ getDatas()
Returns the query data, regardless of the method.
- Returns
- array
Definition at line 73 of file URequest.php.
◆ getInput()
Returns the query data, for PUT, DELETE PATCH methods.
Definition at line 63 of file URequest.php.
◆ getMethod()
Returns the http method.
- Returns
- string
Definition at line 167 of file URequest.php.
◆ getPost()
static getPost |
( |
|
$function = "htmlentities" | ) |
|
|
static |
Call a cleaning function on the post.
- Parameters
-
string | $function | the cleaning function, default htmlentities |
- Returns
- array
Definition at line 56 of file URequest.php.
◆ getUrl()
◆ getUrlParts()
◆ isAjax()
Returns true if the request is an Ajax request.
- Returns
- boolean
Definition at line 101 of file URequest.php.
◆ isCrossSite()
Returns true if the request is cross site.
- Returns
- boolean
Definition at line 117 of file URequest.php.
◆ isJSON()
Returns true if request contentType is set to json.
- Returns
- boolean
Definition at line 125 of file URequest.php.
◆ isPost()
Returns true if the request is sent by the POST method.
- Returns
- boolean
Definition at line 109 of file URequest.php.
◆ post()
static post |
( |
|
$key, |
|
|
|
$default = NULL |
|
) |
| |
|
static |
Returns the value of the $key variable passed by the post method or $default if the $key variable does not exist.
- Parameters
-
string | $key | |
string | $default | return value by default |
- Returns
- string
Definition at line 146 of file URequest.php.
◆ setGetValuesToObject()
static setGetValuesToObject |
( |
|
$object | ) |
|
|
static |
Affects member to member the values of $_GET to the members of the object $object $object must have accessors to each members.
- Parameters
-
Definition at line 38 of file URequest.php.
◆ setPostValuesToObject()
static setPostValuesToObject |
( |
|
$object | ) |
|
|
static |
Affects member to member the values of $_POST to the members of the object $object $object must have accessors to each members.
- Parameters
-
Definition at line 47 of file URequest.php.
◆ setValuesToObject()
static setValuesToObject |
( |
|
$object, |
|
|
|
$values = null |
|
) |
| |
|
static |
Affects member to member the values of the associative array $values to the members of the object $object Used for example to retrieve the variables posted and assign them to the members of an object.
- Parameters
-
object | $object | |
| associative | array $values |
Definition at line 21 of file URequest.php.
The documentation for this class was generated from the following file: