Ubiquity  2.0.0
php rapid development framework
RequestUtils Class Reference

Request utilities. More...

Static Public Member Functions

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 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...
 

Detailed Description

Request utilities.

Author
jc
Version
1.0.0.1

Definition at line 12 of file RequestUtils.php.

Member Function Documentation

◆ 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$defaultreturn value by default
Returns
string

Definition at line 117 of file RequestUtils.php.

◆ getContentType()

static getContentType ( )
static

Returns the request content-type header.

Returns
string

Definition at line 70 of file RequestUtils.php.

◆ getDatas()

static getDatas ( )
static

Returns the query data, regardless of the method.

Returns
array

Definition at line 54 of file RequestUtils.php.

◆ getInput()

static getInput ( )
static

Returns the query data, for PUT, DELETE PATCH methods.

Definition at line 44 of file RequestUtils.php.

◆ getMethod()

static getMethod ( )
static

Returns the http method.

Returns
string

Definition at line 147 of file RequestUtils.php.

◆ getPost()

static getPost (   $function = "htmlentities")
static

Call a cleaning function on the post.

Parameters
string$functionthe cleaning function, default htmlentities
Returns
array

Definition at line 37 of file RequestUtils.php.

◆ getUrl()

static getUrl (   $url)
static

Definition at line 131 of file RequestUtils.php.

◆ getUrlParts()

static getUrlParts ( )
static

Definition at line 139 of file RequestUtils.php.

◆ isAjax()

static isAjax ( )
static

Returns true if the request is an Ajax request.

Returns
boolean

Definition at line 82 of file RequestUtils.php.

◆ isCrossSite()

static isCrossSite ( )
static

Returns true if the request is cross site.

Returns
boolean

Definition at line 98 of file RequestUtils.php.

◆ isJSON()

static isJSON ( )
static

Returns true if request contentType is set to json.

Returns
boolean

Definition at line 106 of file RequestUtils.php.

◆ isPost()

static isPost ( )
static

Returns true if the request is sent by the POST method.

Returns
boolean

Definition at line 90 of file RequestUtils.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$defaultreturn value by default
Returns
string

Definition at line 127 of file RequestUtils.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
associativearray $values

Definition at line 20 of file RequestUtils.php.


The documentation for this class was generated from the following file: