public static
string
|
#
getUri( )
Gets the full request path.
Gets the full request path.
Returns
string
Since
1.5
|
public static
string
|
#
getMethod( )
Gets the request method.
Returns
string
Since
1.5
|
public static
mixed
|
#
getVar( string $name, mixed $default = null, string $hash = 'default', string $type = 'none', integer $mask = 0 )
Fetches and returns a given variable.
Fetches and returns a given variable.
The default behaviour is fetching variables depending on the current request
method: GET and HEAD will result in returning an entry from $_GET, POST and PUT
will result in returning an entry from $_POST.
You can force the source by setting the $hash parameter:
post $_POST get $_GET files $_FILES cookie $_COOKIE env $_ENV server $_SERVER
method via current $_SERVER['REQUEST_METHOD'] default $_REQUEST
Parameters
- $name
string - $name Variable name.
- $default
mixed - $default Default value if the variable does not exist.
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD).
- $type
string - $type Return type for the variable, for valid values see JFilterInput::clean() .
- $mask
integer - $mask Filter mask for the variable.
Returns
mixed - Requested variable.
Since
1.5
|
public static
integer
|
#
getInt( string $name, integer $default = 0, string $hash = 'default' )
Fetches and returns a given filtered variable. The integer filter will allow
only digits and the - sign to be returned. This is currently only a proxy
function for getVar().
Fetches and returns a given filtered variable. The integer filter will allow
only digits and the - sign to be returned. This is currently only a proxy
function for getVar().
See getVar() for more in-depth documentation on the parameters.
Parameters
- $name
string - $name Variable name.
- $default
integer - $default Default value if the variable does not exist.
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD).
Returns
integer - Requested variable.
Since
1.5
|
public static
integer
|
#
getUInt( string $name, integer $default = 0, string $hash = 'default' )
Fetches and returns a given filtered variable. The unsigned integer filter
will allow only digits to be returned. This is currently only a proxy function
for getVar().
Fetches and returns a given filtered variable. The unsigned integer filter
will allow only digits to be returned. This is currently only a proxy function
for getVar().
See getVar() for more in-depth documentation on the parameters.
Parameters
- $name
string - $name Variable name.
- $default
integer - $default Default value if the variable does not exist.
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD).
Returns
integer - Requested variable.
Since
1.7
|
public static
float
|
#
getFloat( string $name, float $default = 0.0, string $hash = 'default' )
Fetches and returns a given filtered variable. The float filter only allows
digits and periods. This is currently only a proxy function for getVar().
Fetches and returns a given filtered variable. The float filter only allows
digits and periods. This is currently only a proxy function for getVar().
See getVar() for more in-depth documentation on the parameters.
Parameters
- $name
string - $name Variable name.
- $default
float - $default Default value if the variable does not exist.
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD).
Returns
float - Requested variable.
Since
1.5
|
public static
boolean
|
#
getBool( string $name, boolean $default = false, string $hash = 'default' )
Fetches and returns a given filtered variable. The bool filter will only
return true/false bool values. This is currently only a proxy function for
getVar().
Fetches and returns a given filtered variable. The bool filter will only
return true/false bool values. This is currently only a proxy function for
getVar().
See getVar() for more in-depth documentation on the parameters.
Parameters
- $name
string - $name Variable name.
- $default
boolean - $default Default value if the variable does not exist.
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD).
Returns
boolean - Requested variable.
Since
1.5
|
public static
string
|
#
getWord( string $name, string $default = '', string $hash = 'default' )
Fetches and returns a given filtered variable. The word filter only allows
the characters [A-Za-z_]. This is currently only a proxy function for
getVar().
Fetches and returns a given filtered variable. The word filter only allows
the characters [A-Za-z_]. This is currently only a proxy function for
getVar().
See getVar() for more in-depth documentation on the parameters.
Parameters
- $name
string - $name Variable name.
- $default
string - $default Default value if the variable does not exist.
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD).
Returns
string - Requested variable.
Since
1.5
|
public static
string
|
#
getCmd( string $name, string $default = '', string $hash = 'default' )
Cmd (Word and Integer0 filter
Cmd (Word and Integer0 filter
Fetches and returns a given filtered variable. The cmd filter only allows the
characters [A-Za-z0-9.-_]. This is currently only a proxy function for
getVar().
See getVar() for more in-depth documentation on the parameters.
Parameters
- $name
string - $name Variable name
- $default
string - $default Default value if the variable does not exist
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
Returns
string - Requested variable
Since
1.5
|
public static
string
|
#
getString( string $name, string $default = '', string $hash = 'default', integer $mask = 0 )
Fetches and returns a given filtered variable. The string filter deletes
'bad' HTML code, if not overridden by the mask. This is currently only a proxy
function for getVar().
Fetches and returns a given filtered variable. The string filter deletes
'bad' HTML code, if not overridden by the mask. This is currently only a proxy
function for getVar().
See getVar() for more in-depth documentation on the parameters.
Parameters
- $name
string - $name Variable name
- $default
string - $default Default value if the variable does not exist
- $hash
string - $hash Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
- $mask
integer - $mask Filter mask for the variable
Returns
string - Requested variable
Since
1.5
|
public static
string
|
#
setVar( string $name, string $value = null, string $hash = 'method', boolean $overwrite = true )
Set a variable in one of the request variables.
Set a variable in one of the request variables.
Parameters
- $name
string - $name Name
- $value
string - $value Value
- $hash
string - $hash Hash
- $overwrite
boolean - $overwrite Boolean
Returns
string - Previous value
Since
1.5
|
public static
mixed
|
#
get( string $hash = 'default', integer $mask = 0 )
Fetches and returns a request array.
Fetches and returns a request array.
The default behaviour is fetching variables depending on the current request
method: GET and HEAD will result in returning $_GET, POST and PUT will result in
returning $_POST.
You can force the source by setting the $hash parameter:
post $_POST get $_GET files $_FILES cookie $_COOKIE env $_ENV server $_SERVER
method via current $_SERVER['REQUEST_METHOD'] default $_REQUEST
Parameters
- $hash
string - $hash to get (POST, GET, FILES, METHOD).
- $mask
integer - $mask Filter mask for the variable.
Returns
mixed - Request hash.
Since
1.5
See
|
public static
|
#
set( array $array, string $hash = 'default', boolean $overwrite = true )
Sets a request variable.
Parameters
- $array
array - $array An associative array of key-value pairs.
- $hash
string - $hash The request variable to set (POST, GET, FILES, METHOD).
- $overwrite
boolean - $overwrite If true and an existing key is found, the value is overwritten,
otherwise it is ignored.
Since
1.5
|
public static
boolean
|
#
checkToken( string $method = 'post' )
Checks for a form token in the request.
Checks for a form token in the request.
Use in conjunction with JHtml::_('form.token').
Parameters
- $method
string - $method The request method in which to look for the token key.
Returns
boolean - True if found and valid, false otherwise.
Since
1.5
|
protected static
mixed
|
#
_cleanVar( mixed $var, integer $mask = 0, string $type = null )
Clean up an input variable.
Clean up an input variable.
Parameters
- $var
mixed - $var The input variable.
- $mask
integer - $mask Filter bit mask. 1 = no trim: If this flag is cleared and the input is a
string, the string will have leading and trailing whitespace trimmed. 2 =
allow_raw: If set, no more filtering is performed, higher bits are ignored. 4 =
allow_html: HTML is allowed, but passed through a safe HTML filter first. If
set, no more filtering is performed. If no bits other than the 1 bit is set, a
strict filter is applied.
- $type
string - $type The variable type JFilterInput::clean() .
Returns
mixed - Same as $var
Since
1.5
|