Ubiquity  2.0.3
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 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)
 

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 171 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 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()

static getDatas ( )
static

Returns the query data, regardless of the method.

Returns
array

Definition at line 73 of file URequest.php.

◆ getInput()

static getInput ( )
static

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

Definition at line 63 of file URequest.php.

◆ getMethod()

static getMethod ( )
static

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$functionthe cleaning function, default htmlentities
Returns
array

Definition at line 56 of file URequest.php.

◆ getUrl()

static getUrl (   $url)
static

Definition at line 150 of file URequest.php.

◆ getUrlParts()

static getUrlParts ( )
static

Definition at line 159 of file URequest.php.

◆ isAjax()

static isAjax ( )
static

Returns true if the request is an Ajax request.

Returns
boolean

Definition at line 101 of file URequest.php.

◆ isCrossSite()

static isCrossSite ( )
static

Returns true if the request is cross site.

Returns
boolean

Definition at line 117 of file URequest.php.

◆ isJSON()

static isJSON ( )
static

Returns true if request contentType is set to json.

Returns
boolean

Definition at line 125 of file URequest.php.

◆ isPost()

static isPost ( )
static

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$defaultreturn 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
object$object

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
object$object

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
associativearray $values

Definition at line 21 of file URequest.php.


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