class Input implements Serializable, Countable (View source)

Class Input

Properties

Input $get
Input $post
FormDataInput $put
FormDataInput $patch
FormDataInput $delete
$link
$unlink
Input $request
Input $server
Input $env
Input $header
PsrFilesInput $files
$cookie

Methods

__construct(array $source = null, InputFilter $filter = null)

Constructor.

void
prepareSource(array $source = null, boolean $reference = false)

Prepare source.

__get(mixed $name)

Magic method to get an input object

void
__set(string $name, Input $value)

__set

integer
count()

Get the number of variables.

mixed
get(string $name, mixed $default = null, string $filter = 'cmd', string $separator = '.')

Gets a value from the input data.

set(string $name, mixed $value, string $separator = '.')

Sets a value

def(string $name, mixed $value, string $separator = '.')

Define a value. The value will only be set if there's no value for the name or if it is null.

bool
exists(string $name, string $separator = '.')

Check if a value name exists.

mixed
compact(array $vars = array(), mixed $datasource = null)

Gets an array of values from the request.

extract(string $name, string $separator = '.')

extract

merge(array $array, bool $recursive = false)

merge

mixed
__call(string $name, array $arguments)

Magic method to get filtered input data.

string
getMethod()

Gets the request method.

setMethod(string $method)

Method to set property method

string
serialize()

Method to serialize the input.

unserialize(string $input)

Method to unserialize the input.

void
loadAllInputs()

Method to load all of the global inputs.

Input[]
getAllInputs()

getAllInputs

array
dumpAllInputs()

dumpAllInputs

setData(array $data)

Method to set property data

getFilter()

Method to get property Filter

setFilter(InputFilter $filter)

Method to set property filter

array
getRawData()

Method to get property Data

array
toArray(string $filter = 'raw')

toArray

static mixed
getByPath(mixed $data, mixed $path, string $separator = '.')

Get data from array or object by path.

static boolean
setByPath(mixed $data, string $path, mixed $value, string $separator = '.', string $storeType = 'array')

setByPath

integer
getInt($name, $default = null)

Get a signed integer.

integer
getUint($name, $default = null)

Get an unsigned integer.

float
getFloat($name, $default = null)

Get a floating-point number.

boolean
getBool($name, $default = null)

Get a boolean.

boolean
getBoolean($name, $default = null)

Get a boolean.

string
getWord($name, $default = null)

No description

string
getAlnum($name, $default = null)

No description

string
getCmd($name, $default = null)

No description

string
getBase64($name, $default = null)

No description

string
getString($name, $default = null)

No description

string
getArray($name, $default = null)

No description

string
getHtml($name, $default = null)

No description

string
getPath($name, $default = null)

No description

string
getUsername($name, $default = null)

No description

string
getEmail($name, $default = null)

No description

string
getUrl($name, $default = null)

Get URL

string
getRaw($name, $default = null)

Get raw data

mixed
getVar($name, $default = null)

Get string or array and filter them.

Details

at line line 93
__construct(array $source = null, InputFilter $filter = null)

Constructor.

Parameters

array $source Optional source data. If omitted, a copy of the server variable '_REQUEST' is used.
InputFilter $filter The input filter object.

at line line 115
void prepareSource(array $source = null, boolean $reference = false)

Prepare source.

Parameters

array $source Optional source data. If omitted, a copy of the server variable '_REQUEST' is used.
boolean $reference If set to true, he source in first argument will be reference.

Return Value

void

at line line 143
Input __get(mixed $name)

Magic method to get an input object

Parameters

mixed $name Name of the input object to retrieve.

Return Value

Input The request input object

at line line 195
void __set(string $name, Input $value)

__set

Parameters

string $name
Input $value

Return Value

void

at line line 216
integer count()

Get the number of variables.

Return Value

integer The number of variables in the input.

See also

Countable::count()

at line line 233
mixed get(string $name, mixed $default = null, string $filter = 'cmd', string $separator = '.')

Gets a value from the input data.

Parameters

string $name Name of the value to get.
mixed $default Default value to return if variable does not exist.
string $filter Filter to apply to the value.
string $separator Separator for path.

Return Value

mixed The filtered input value.

at line line 254
set(string $name, mixed $value, string $separator = '.')

Sets a value

Parameters

string $name Name of the value to set.
mixed $value Value to assign to the input.
string $separator Symbol to separate path.

at line line 268
def(string $name, mixed $value, string $separator = '.')

Define a value. The value will only be set if there's no value for the name or if it is null.

Parameters

string $name Name of the value to define.
mixed $value Value to assign to the input.
string $separator Symbol to separate paths.

at line line 288
bool exists(string $name, string $separator = '.')

Check if a value name exists.

Parameters

string $name Value name
string $separator Symbol to separate path.

Return Value

bool

at line line 305
mixed compact(array $vars = array(), mixed $datasource = null)

Gets an array of values from the request.

Parameters

array $vars Associative array of keys and filter types to apply. If empty and datasource is null, all the input data will be returned but filtered using the default case in JFilterInput::clean.
mixed $datasource Array to retrieve data from, or null

Return Value

mixed The filtered input data.

at line line 357
Input extract(string $name, string $separator = '.')

extract

Parameters

string $name
string $separator

Return Value

Input

at line line 372
Input merge(array $array, bool $recursive = false)

merge

Parameters

array $array
bool $recursive

Return Value

Input

at line line 423
mixed __call(string $name, array $arguments)

Magic method to get filtered input data.

Parameters

string $name Name of the filter type prefixed with 'get'.
array $arguments [0] The name of the variable [1] The default value.

Return Value

mixed The filtered input value.

at line line 452
string getMethod()

Gets the request method.

Return Value

string The request method.

at line line 474
Input setMethod(string $method)

Method to set property method

Parameters

string $method

Return Value

Input Return self to support chaining.

at line line 488
string serialize()

Method to serialize the input.

Return Value

string The serialized input.

at line line 511
Input unserialize(string $input)

Method to unserialize the input.

Parameters

string $input The serialized input.

Return Value

Input The input object.

at line line 526
void loadAllInputs()

Method to load all of the global inputs.

Return Value

void

at line line 560
Input[] getAllInputs()

getAllInputs

Return Value

Input[]

at line line 572
array dumpAllInputs()

dumpAllInputs

Return Value

array

at line line 593
Input setData(array $data)

Method to set property data

Parameters

array $data

Return Value

Input Return self to support chaining.

at line line 605
InputFilter getFilter()

Method to get property Filter

Return Value

InputFilter

at line line 617
Input setFilter(InputFilter $filter)

Method to set property filter

Parameters

InputFilter $filter

Return Value

Input Return self to support chaining.

at line line 629
array getRawData()

Method to get property Data

Return Value

array

at line line 641
array toArray(string $filter = 'raw')

toArray

Parameters

string $filter

Return Value

array

at line line 686
static mixed getByPath(mixed $data, mixed $path, string $separator = '.')

Get data from array or object by path.

Example: ArrayHelper::getByPath($array, 'foo.bar.yoo') equals to $array['foo']['bar']['yoo'].

Parameters

mixed $data An array or object to get value.
mixed $path The key path.
string $separator Separator of paths.

Return Value

mixed Found value, null if not exists.

at line line 729
static boolean setByPath(mixed $data, string $path, mixed $value, string $separator = '.', string $storeType = 'array')

setByPath

Parameters

mixed $data &$data
string $path
mixed $value
string $separator
string $storeType

Return Value

boolean

at line line 52
integer getInt($name, $default = null)

Get a signed integer.

Parameters

$name
$default

Return Value

integer

at line line 52
integer getUint($name, $default = null)

Get an unsigned integer.

Parameters

$name
$default

Return Value

integer

at line line 52
float getFloat($name, $default = null)

Get a floating-point number.

Parameters

$name
$default

Return Value

float

at line line 52
boolean getBool($name, $default = null)

Get a boolean.

Parameters

$name
$default

Return Value

boolean

at line line 52
boolean getBoolean($name, $default = null)

Get a boolean.

Parameters

$name
$default

Return Value

boolean

at line line 52
string getWord($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getAlnum($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getCmd($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getBase64($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getString($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getArray($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getHtml($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getPath($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getUsername($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getEmail($name, $default = null)

Parameters

$name
$default

Return Value

string

at line line 52
string getUrl($name, $default = null)

Get URL

Parameters

$name
$default

Return Value

string

at line line 52
string getRaw($name, $default = null)

Get raw data

Parameters

$name
$default

Return Value

string

at line line 52
mixed getVar($name, $default = null)

Get string or array and filter them.

Parameters

$name
$default

Return Value

mixed