Methods summary
public
|
#
__construct( UrlScript $url, $query = NULL, $post = NULL, $files = NULL, $cookies = NULL, $headers = NULL, $method = NULL, $remoteAddress = NULL, $remoteHost = NULL )
|
public
UrlScript
|
#
getUrl( )
Returns URL object.
Returns
Implementation of
|
public
|
|
public
mixed
|
#
getQuery( string $key = NULL, mixed $default = NULL )
Returns variable provided to the script via URL query ($_GET). If no key is
passed, returns the entire array.
Returns variable provided to the script via URL query ($_GET). If no key is
passed, returns the entire array.
Parameters
- $key
string key
- $default
mixed default value
Returns
mixed
Implementation of
|
public
mixed
|
#
getPost( string $key = NULL, mixed $default = NULL )
Returns variable provided to the script via POST method ($_POST). If no key
is passed, returns the entire array.
Returns variable provided to the script via POST method ($_POST). If no key
is passed, returns the entire array.
Parameters
- $key
string key
- $default
mixed default value
Returns
mixed
Implementation of
|
public
HttpUploadedFile
|
#
getFile( string $key )
Returns uploaded file.
Parameters
- $key
string key (or more keys)
Returns
Implementation of
|
public
array
|
#
getFiles( )
Returns uploaded files.
Returns
array
Implementation of
|
public
mixed
|
#
getCookie( string $key, mixed $default = NULL )
Returns variable provided to the script via HTTP cookies.
Returns variable provided to the script via HTTP cookies.
Parameters
- $key
string key
- $default
mixed default value
Returns
mixed
Implementation of
|
public
array
|
#
getCookies( )
Returns variables provided to the script via HTTP cookies.
Returns variables provided to the script via HTTP cookies.
Returns
array
Implementation of
|
public
string
|
#
getMethod( )
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is
case-sensitive.
Returns HTTP request method (GET, POST, HEAD, PUT, ...). The method is
case-sensitive.
Returns
string
Implementation of
|
public
boolean
|
#
isMethod( string $method )
Checks if the request method is the given one.
Checks if the request method is the given one.
Parameters
Returns
boolean
Implementation of
|
public
boolean
|
#
isPost( )
Checks if the request method is POST.
Checks if the request method is POST.
Returns
boolean
|
public
Url |null
|
|
public
boolean
|
#
isSecured( )
Is the request is sent via secure channel (https).
Is the request is sent via secure channel (https).
Returns
boolean
Implementation of
|
public
boolean
|
#
isAjax( )
Is AJAX request?
Returns
boolean
Implementation of
|
public
string
|
#
getRemoteAddress( )
Returns the IP address of the remote client.
Returns the IP address of the remote client.
Returns
string
Implementation of
|
public
string
|
#
getRemoteHost( )
Returns the host of the remote client.
Returns the host of the remote client.
Returns
string
Implementation of
|
public
string
|
#
detectLanguage( array $langs )
Parse Accept-Language header and returns prefered language.
Parse Accept-Language header and returns prefered language.
Parameters
- $langs
array Supported languages
Returns
string
|