Elgg  Version 3.0
Public Member Functions | Protected Attributes | List of all members
Elgg\Http\Input Class Reference

Public Member Functions

 __construct (Request $request)
 Constructor. More...
 
 set ($key, $value)
 Sets an input value that may later be retrieved by get_input. More...
 
 get ($key, $default=null, $filter_result=true)
 Get some input from variables passed submitted through GET or POST. More...
 
 all ($filter_result=true)
 Returns all values parsed from the request. More...
 

Protected Attributes

 $request
 

Detailed Description

Definition at line 17 of file Input.php.

Constructor & Destructor Documentation

Elgg\Http\Input::__construct ( Request  $request)

Constructor.

Parameters
Request$requestHttp Request object

Definition at line 29 of file Input.php.

Member Function Documentation

Elgg\Http\Input::all (   $filter_result = true)

Returns all values parsed from the request.

Parameters
bool$filter_resultSanitize input values
Returns
array

Definition at line 90 of file Input.php.

Elgg\Http\Input::get (   $key,
  $default = null,
  $filter_result = true 
)

Get some input from variables passed submitted through GET or POST.

If using any data obtained from get_input() in a web page, please be aware that it is a possible vector for a reflected XSS attack. If you are expecting an integer, cast it to an int. If it is a string, escape quotes.

Note: this function does not handle nested arrays (ex: form input of param[m][n]) because of the filtering done in htmlawed from the filter_tags call.

Parameters
string$keyThe variable name we want.
mixed$defaultA default value for the variable if it is not found.
bool$filter_resultIf true, then the result is filtered for bad tags.
Returns
mixed

Definition at line 64 of file Input.php.

Elgg\Http\Input::set (   $key,
  $value 
)

Sets an input value that may later be retrieved by get_input.

Note: this function does not handle nested arrays (ex: form input of param[m][n])

Parameters
string$keyThe name of the variable
string|string[]$value The value of the variable
Returns
void

Definition at line 43 of file Input.php.

Member Data Documentation

Elgg\Http\Input::$request
protected

Definition at line 22 of file Input.php.


The documentation for this class was generated from the following file: