Ubiquity  2.0.0
php rapid development framework
URequest Class Reference

Http 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...
 
static cleanUrl ($url)
 

Detailed Description

Http Request utilities.

Author
jc
Version
1.0.0.2

Definition at line 13 of file URequest.php.

Member Function Documentation

◆ cleanUrl()

static cleanUrl (   $url)
static

Definition at line 153 of file URequest.php.

◆ 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 118 of file URequest.php.

◆ getContentType()

static getContentType ( )
static

Returns the request content-type header.

Returns
string

Definition at line 71 of file URequest.php.

◆ getDatas()

static getDatas ( )
static

Returns the query data, regardless of the method.

Returns
array

Definition at line 55 of file URequest.php.

◆ getInput()

static getInput ( )
static

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

Definition at line 45 of file URequest.php.

◆ getMethod()

static getMethod ( )
static

Returns the http method.

Returns
string

Definition at line 149 of file URequest.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 38 of file URequest.php.

◆ getUrl()

static getUrl (   $url)
static

Definition at line 132 of file URequest.php.

◆ getUrlParts()

static getUrlParts ( )
static

Definition at line 141 of file URequest.php.

◆ isAjax()

static isAjax ( )
static

Returns true if the request is an Ajax request.

Returns
boolean

Definition at line 83 of file URequest.php.

◆ isCrossSite()

static isCrossSite ( )
static

Returns true if the request is cross site.

Returns
boolean

Definition at line 99 of file URequest.php.

◆ isJSON()

static isJSON ( )
static

Returns true if request contentType is set to json.

Returns
boolean

Definition at line 107 of file URequest.php.

◆ isPost()

static isPost ( )
static

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

Returns
boolean

Definition at line 91 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$defaultreturn value by default
Returns
string

Definition at line 128 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
associativearray $values

Definition at line 21 of file URequest.php.


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