Json

Extends \Joomla\CMS\Input\Input

Joomla! Input JSON Class

deprecated

This class decodes a JSON string from the raw request data and makes it available via the standard JInput interface.

since

3.0.1

deprecated

5.0 Use Joomla\Input\Json instead

Methods

__call

Magic method to get filtered input data.

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

1.0

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()) 
inherited
since

1.0

Arguments

$source

arrayOptional source data. If omitted, a copy of the server variable '_REQUEST' is used.

$options

arrayAn optional associative array of configuration parameters: filter: An instance of Filter\Input. If omitted, a default filter is initialised.

__get

Magic method to get an input object

__get(mixed $name) : \Joomla\Input\Input
inherited
since

1.0

Arguments

$name

mixedName of the input object to retrieve.

Response

\Joomla\Input\InputThe request input object

count

Get the number of variables.

count() : integer
inherited
since

1.0

see \Joomla\Input\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
inherited
since

1.0

Arguments

$name

stringName of the value to define.

$value

mixedValue to assign to the input.

exists

Check if a value name exists.

exists(string $name) : boolean
inherited
since

1.2.0

Arguments

$name

stringValue name

Response

boolean

get

Gets a value from the input data.

get(string $name, mixed $default = null, string $filter = 'cmd') : mixed
inherited
see \Joomla\Filter\InputFilter::clean()
since

1.0

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
inherited

Get an alphanumeric string.

Arguments

$name

mixed

$default

\=

Response

string

getArray

Gets an array of values from the request.

getArray(array $vars = array(), mixed $datasource = null) : mixed
inherited
since

1.0

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 default case in JFilterInput::clean.

$datasource

mixedArray to retrieve data from, or null

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
inherited deprecated
since

3.4.2

deprecated

5.0 Use Joomla\Input\Input instead

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
inherited

Get a base64 encoded string.

Arguments

$name

mixed

$default

\=

Response

string

getBool

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

Get a boolean value.

Arguments

$name

mixed

$default

\=

Response

boolean

getCmd

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

Get a CMD filtered string.

Arguments

$name

mixed

$default

\=

Response

string

getFloat

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

Get a floating-point number.

Arguments

$name

mixed

$default

\=

Response

float

getHtml

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

Get a HTML string.

Arguments

$name

mixed

$default

\=

Response

string

getInputForRequestMethod

Get the Input instance holding the data for the current request method

getInputForRequestMethod() : \Joomla\Input\Input
inherited
since

1.3.0

Response

\Joomla\Input\Input

getInt

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

Get a signed integer.

Arguments

$name

mixed

$default

\=

Response

integer

getMethod

Gets the request method.

getMethod() : string
inherited
since

1.0

Response

stringThe request method.

getPath

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

Get a file path.

Arguments

$name

mixed

$default

\=

Response

string

getRaw

Gets the raw JSON string from the request.

getRaw() : string
deprecated
since

3.0.1

deprecated

5.0 Use Joomla\Input\Json instead

Response

stringThe raw JSON string from the request.

getString

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

Get a string.

Arguments

$name

mixed

$default

\=

Response

string

getUint

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

Get an unsigned integer.

Arguments

$name

mixed

$default

\=

Response

integer

getUsername

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

Get a username.

Arguments

$name

mixed

$default

\=

Response

string

getWord

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

Get a word.

Arguments

$name

mixed

$default

\=

Response

string

loadAllInputs

Method to load all of the global inputs.

loadAllInputs() : void
inherited
since

1.0

serialize

Method to serialize the input.

serialize() : string
inherited
since

1.0

Response

stringThe serialized input.

set

Sets a value

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

1.0

Arguments

$name

stringName of the value to set.

$value

mixedValue to assign to the input.

unserialize

Method to unserialize the input.

unserialize(string $input) : void
inherited
since

1.0

Arguments

$input

stringThe serialized input.

Properties

_raw

The raw JSON string from the request.

deprecated
since

3.0.1

deprecated

5.0 Use Joomla\Input\Json instead

Type(s)

string

allowedGlobals

Container with allowed superglobals

inherited static
since

1.3.0

note

Once PHP 7.1 is the minimum supported version this should become a private constant

Type(s)

array

inputs

Input objects

inherited
since

1.0

Type(s)

array<mixed,\Joomla\Input\Input>

options

Options array for the Input instance.

inherited
since

1.0

Type(s)

array

filter

Filter object to use.

inherited
since

1.0

Type(s)

\Joomla\Filter\InputFilter

data

Input data.

inherited
since

1.0

Type(s)

array

loaded

Is all GLOBAL added

inherited static
since

1.1.4

Type(s)

boolean

get

inherited

Type(s)

\Joomla\CMS\Input\Input

post

inherited

Type(s)

\Joomla\CMS\Input\Input

request

inherited

Type(s)

\Joomla\CMS\Input\Input

server

inherited

Type(s)

\Joomla\CMS\Input\Input

env

inherited

Type(s)

\Joomla\CMS\Input\Input

files

inherited

Type(s)

\Joomla\CMS\Input\Files

get

inherited

Type(s)

\Joomla\Input\Input

post

inherited

Type(s)

\Joomla\Input\Input

request

inherited

Type(s)

\Joomla\Input\Input

server

inherited

Type(s)

\Joomla\Input\Input

env

inherited

Type(s)

\Joomla\Input\Input

files

inherited

Type(s)

\Joomla\Input\Files