Class JRequest

Description

JRequest Class

This class serves to provide the Joomla Framework with a common interface to access request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables can be passed through an input filter to avoid injection or returned raw.

The concept and implementation of this class is inspired by the binary cloud environment package. <http://www.binarycloud.com/>

Located in /application/environment/request.php (line 37)


	
			
Method Summary
 mixed cleanVar (mixed &$var, int $mask)
 mixed getVar (string $name, [string $default = null], [string $hash = 'default'], [string $type = 'string'], int $mask)
Methods
cleanVar (line 175)

Utility method to clean a string variable using input filters

Available Options masks: _J_NOTRIM : Prevents the trimming of the variable _J_ALLOWHTML : Allows safe HTML in the variable _J_ALLOWRAW : Allows raw input

  • return: The cleaned variable
  • since: 1.1
  • static:
mixed cleanVar (mixed &$var, int $mask)
  • mixed $var: The variable to clean
  • int $mask: An options mask
getVar (line 66)

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 method via current $_SERVER['REQUEST_METHOD'] default via default order (GET, POST, FILE)

  • return: Requested variable
  • since: 1.1
  • static:
mixed getVar (string $name, [string $default = null], [string $hash = 'default'], [string $type = 'string'], int $mask)
  • string $name: Variable name
  • string $default: Default value if the variable does not exist
  • string $hash: Where the var should come from (POST, GET, FILES, METHOD)
  • string $type: Return type for the variable (INT, FLOAT, STRING, BOOLEAN, ARRAY)
  • int $mask: Filter mask for the variable

Documentation generated on Sat, 4 Feb 2006 14:26:23 +0100 by phpDocumentor 1.3.0RC4