JInput

Implements \Serializable, \Countable

Joomla! Input Base Class

This is an abstracted input class used to manage retrieving data from the application environment.

since

11.1

property-read
property-read
property-read
property-read
property-read
property-read
package

Joomla.Platform

Methods

__call

Magic method to get filtered input data.

__call(string $name, array $arguments) : mixed
since

11.1

Arguments

$name

stringName of the filter type prefixed with 'get'.

$arguments

array[0] The name of the variable [1] The default value.

Response

mixedThe filtered input value.

__construct

Constructor.

__construct(array $source = null, array $options = array()) 
since

11.1

Arguments

$source

arraySource data (Optional, default is $_REQUEST)

$options

arrayArray of configuration parameters (Optional)

__get

Magic method to get an input object

__get(mixed $name) : \JInput
since

11.1

Arguments

$name

mixedName of the input object to retrieve.

Response

\JInputThe request input object

count

Get the number of variables.

count() : integer
since

12.2

see \Countable::count()

Response

integerThe number of variables in the input.

def

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

def(string $name, mixed $value) : void
since

12.1

Arguments

$name

stringName of the value to define.

$value

mixedValue to assign to the input.

get

Gets a value from the input data.

get(string $name, mixed $default = null, string $filter = 'cmd') : mixed
since

11.1

Arguments

$name

stringName of the value to get.

$default

mixedDefault value to return if variable does not exist.

$filter

stringFilter to apply to the value.

Response

mixedThe filtered input value.

getAlnum

getAlnum(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

getArray

Gets an array of values from the request.

getArray(array $vars = array(), mixed $datasource = null, string $defaultFilter = 'unknown') : mixed
since

11.1

Arguments

$vars

arrayAssociative 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 filter given by the parameter defaultFilter in JFilterInput::clean.

$datasource

mixedArray to retrieve data from, or null.

$defaultFilter

stringDefault filter used in JFilterInput::clean if vars is empty and datasource is null. If 'unknown', the default case is used in JFilterInput::clean.

Response

mixedThe filtered input data.

getArrayRecursive

Gets an array of values from the request.

getArrayRecursive(array $vars = array(), mixed $datasource = null, string $defaultFilter = 'unknown', boolean $recursion = false) : mixed
since

3.4.2

Arguments

$vars

arrayAssociative 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 filter given by the parameter defaultFilter in JFilterInput::clean.

$datasource

mixedArray to retrieve data from, or null.

$defaultFilter

stringDefault filter used in JFilterInput::clean if vars is empty and datasource is null. If 'unknown', the default case is used in JFilterInput::clean.

$recursion

booleanFlag to indicate a recursive function call.

Response

mixedThe filtered input data.

getBase64

getBase64(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

getBool

getBool(mixed $name, \= $default) : boolean

Get a boolean.

Arguments

$name

mixed

$default

\=

Response

boolean

getCmd

getCmd(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

getFloat

getFloat(mixed $name, \= $default) : float

Get a floating-point number.

Arguments

$name

mixed

$default

\=

Response

float

getHtml

getHtml(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

getInt

getInt(mixed $name, \= $default) : integer

Get a signed integer.

Arguments

$name

mixed

$default

\=

Response

integer

getMethod

Gets the request method.

getMethod() : string
since

11.1

Response

stringThe request method.

getPath

getPath(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

getString

getString(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

getUint

getUint(mixed $name, \= $default) : integer

Get an unsigned integer.

Arguments

$name

mixed

$default

\=

Response

integer

getUsername

getUsername(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

getWord

getWord(mixed $name, \= $default) : string

Arguments

$name

mixed

$default

\=

Response

string

loadAllInputs

Method to load all of the global inputs.

loadAllInputs() : void
since

12.1

serialize

Method to serialize the input.

serialize() : string
since

12.1

Response

stringThe serialized input.

set

Sets a value

set(string $name, mixed $value) : void
since

11.1

Arguments

$name

stringName of the value to set.

$value

mixedValue to assign to the input.

unserialize

Method to unserialize the input.

unserialize(string $input) : \JInput
since

12.1

Arguments

$input

stringThe serialized input.

Response

\JInputThe input object.

Properties

options

Options array for the JInput instance.

since

11.1

Type(s)

array

filter

Filter object to use.

since

11.1

Type(s)

\JFilterInput

data

Input data.

since

11.1

Type(s)

array

inputs

Input objects

since

11.1

Type(s)

array

get

Type(s)

\JInput

post

Type(s)

\JInput

request

Type(s)

\JInput

server

Type(s)

\JInput

files

Type(s)

\JInputFiles