Methods summary
public
|
|
protected static
|
#
cast( mixed $val, mixed $type = null )
|
public static
mixed
|
#
post( string|null $name = null, mixed $default = null, string $type = null )
Returns POST request contents.
Returns POST request contents.
Parameters
- $name
string|null $name POST request field name. If empty, entire contents of POST request are
returned.
- $default
mixed $default The default value, which is returned if no value is found for the
request field specified in $name parameter.
- $type
string $type Data type to which the value of specified parameter must be converted.
Acceptable data types are described for method get().
Returns
mixed
See
|
public static
boolean
|
#
issetPost( string $name )
Verifies availablility of specified field in POST request.
Verifies availablility of specified field in POST request.
Parameters
- $name
string $name POST request field
Returns
boolean
|
public static
mixed
|
#
get( string|null $name = null, string|null $default = null, string|null $type = null )
Returns the contents of the GET request.
Returns the contents of the GET request.
Parameters
- $name
string|null $name GET request field name. If empty, entire contents of the GET request are
returned.
- $default
string|null $default The default value, which is returned if no value is found for the
request field specified in $name parameter.
- $type
string|null $type Data type to which the cookie record value must be converted, specified by
means of one of TYPE_* constants: waRequest::TYPE_INT - integer
waRequest::TYPE_STRING - string waRequest::TYPE_STRING_TRIM string with trimmed
space characters waRequest::TYPE_ARRAY_INT = array of integers
waRequest::TYPE_ARRAY = array of various data
Returns
mixed
Example
waRequest::get('id', 0, waRequest::TYPE_INT)
|
public static
mixed
|
#
request( string|null $name = null, mixed $default = null, string $type = null )
Returns combined contents of GET and POST requests or the value of specified
request field.
Returns combined contents of GET and POST requests or the value of specified
request field.
Parameters
- $name
string|null $name Request field name. If empty, entire contents of POST and GET request are
returned.
- $default
mixed $default The default value, which is returned if no value is found for the
request field specified in $name parameter.
- $type
string $type Data type to which the value of specified parameter must be converted.
Acceptable data types are described for method get().
Returns
mixed
See
|
public static
waRequestFileIterator
|
#
file( mixed $name )
Returns iterator for file
Returns iterator for file
Returns
|
public static
mixed
|
#
cookie( string|null $name = null, string|null $default = null, string|null $type = null )
Returns information about user's cookie files.
Returns information about user's cookie files.
Parameters
- $name
string|null $name Cookie record id. If not specified, all cookie data received from user is
returned.
- $default
string|null $default The default value, which is returned if no value is found for the
cookie record specified in $name parameter.
- $type
string|null $type Data type to which the request field value must be converted. Acceptable
data types are described for get() method.
Returns
mixed
See
|
public static
boolean
|
#
isXMLHttpRequest( )
Verifies whether current request is an AJAX request.
Verifies whether current request is an AJAX request.
Returns
boolean
|
public static
string
|
#
getUserAgent( )
Returns the contents of server header HTTP_USER_AGENT.
Returns the contents of server header HTTP_USER_AGENT.
Returns
string
|
public static
string|boolean
|
#
isMobile( boolean $check = true )
Determines the use of a mobile device.
Determines the use of a mobile device.
Parameters
- $check
boolean $check Flag requiring to check and update the value of field nomobile in user's
PHP session. If set to true, the following actions are performed: - If the GET
request contains variable named 'nomobile' with a value equivalent to true, then
field 'nomobile' in user's PHP session is set to true. If the value of this
variable is equivalent to false, then field 'nomobile' is removed from user's
session. - If the GET request contains no variable named 'nomobile' and does
contain a variable named 'mobile' with a value equivalent to true, then field
'nomobile' is removed from user's session. - If, upon execution of the above
actions, the value of field 'nomobile' in user's PHP session is equal to true,
then method returns false. Otherwise the method continues its operation so as if
the value of this flag were equal to false. If the flag's value is set to false,
the use of a mobile device is determined by the contents of HTTP_USER_AGENT
header.
Returns
string|boolean If mobile device is detected, one of these identifiers is returned: 'android',
'blackberry', 'iphone', 'opera', 'palm', 'windows', 'generic'; otherwise method
return false.
|
public static
mixed
|
#
server( string|null $name = null, mixed $default = null, string $type = null )
Returns the contents of a server variable (from $_SERVER).
Returns the contents of a server variable (from $_SERVER).
Parameters
- $name
string|null $name Server variable name. If empty, all server variables' values are returned.
- $default
mixed $default The default value, which is returned if no value is found for variable
specified in $name parameter.
- $type
string $type Data type to which the value of specified variable must be converted.
Acceptable data types are described for method get().
Returns
mixed
See
|
public static
|
#
method( )
Alias for waRequest::getMethod()
Alias for waRequest::getMethod()
See
|
public static
string
|
#
getMethod( )
Returns the type of user request.
Returns the type of user request.
Returns
string 'post' or 'get'
|
protected static
|
#
getData( mixed $data, mixed $name = null, mixed $default = null, mixed $type = null )
|
protected static
|
|
public static
mixed
|
#
param( string|null $name = null, mixed $default = null, string $type = null )
Returns additional request parameters.
Returns additional request parameters.
Parameters
- $name
string|null $name Request parameter name. If not specified, method returns values of all
available parameters.
- $default
mixed $default Default value, which is returned if no value is set for the specified
parameter.
- $type
string $type Data type to which the value of specified parameter must be converted.
Acceptable data types are described for method get().
Returns
mixed
See
|
public static
|
#
setParam( string $key, mixed $value = null )
Sets custom values for additional request parameters.
Sets custom values for additional request parameters.
Parameters
- $key
string $key Parameter name.
- $value
mixed $value Parameter value. If not specified, default value null is set.
|
public static
|
#
getIp( string|integer $get_as_int = false )
Returns user's IP address.
Returns user's IP address.
Parameters
- $get_as_int
string|integer $get_as_int IP address either as string or as integer
|
public static
string
|
#
getLocale( string|boolean $default = null, boolean $browser_only = false )
Determines user's locale.
Determines user's locale.
Parameters
- $default
string|boolean $default Default value, which is returned if user's locale cannot be determined.
If true is specified, then the same value is used for $browser_only parameter.
- $browser_only
boolean $browser_only Flag requiring to determine user's locale using browser headers
only and to ignore additional request parameters set using setParam() method.
Returns
string
|
public static
string
|
#
getTheme( )
Returns id of design theme used in current frontend page.
Returns id of design theme used in current frontend page.
Returns
string
|
public static
|
|