JRequest/get
From Joomla! Documentation
< API16:JRequest
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Fetches and returns a request array.
Syntax[edit]
static get($hash= 'default', $mask=0)
Parameter Name | Default Value | Description |
---|---|---|
$hash | 'default' | $hash to get (POST, GET, FILES, METHOD). |
$mask | 0 | $mask Filter mask for the variable. |
Returns[edit]
mixed Request hash.
Defined in[edit]
libraries/joomla/environment/request.php
Importing[edit]
jimport( 'joomla.environment.request' );
Source Body[edit]
public static function get($hash = 'default', $mask = 0)
{
$hash = strtoupper($hash);
if ($hash === 'METHOD') {
$hash = strtoupper($_SERVER['REQUEST_METHOD']);
}
switch ($hash)
{
case 'GET' :
$input = $_GET;
break;
case 'POST' :
$input = $_POST;
break;
case 'FILES' :
$input = $_FILES;
break;
case 'COOKIE' :
$input = $_COOKIE;
break;
case 'ENV':
$input = &$_ENV;
break;
case 'SERVER':
$input = &$_SERVER;
break;
default:
$input = $_REQUEST;
break;
}
$result = self::_cleanVar($input, $mask);
// Handle magic quotes compatability
if (get_magic_quotes_gpc() && ($hash != 'FILES')) {
$result = self::_stripSlashesRecursive($result);
}
return $result;
}
Examples[edit]
Code Examples[edit]