class Json extends Input

Joomla! Input JSON Class

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

Methods

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

Constructor.

__get( mixed $name)

Magic method to get an input object

from Input
mixed
getArray( array $vars = array(), mixed $datasource = null, string $defaultFilter = 'unknown')

Gets an array of values from the request.

from Input
unserialize( string $input)

Method to unserialize the input.

from Input
string
getRaw()

Gets the raw JSON string from the request.

Details

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

Constructor.

Parameters

array $source Source data (Optional, default is $_REQUEST)
array $options Array of configuration parameters (Optional)

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

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

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 filter given by the parameter defaultFilter in JFilterInput::clean.
mixed $datasource Array to retrieve data from, or null.
string $defaultFilter Default filter used in JFilterInput::clean if vars is empty and datasource is null. If 'unknown', the default case is used in JFilterInput::clean.

Return Value

mixed The filtered input data.

Input unserialize( string $input)

Method to unserialize the input.

Parameters

string $input The serialized input.

Return Value

Input The input object.

string getRaw()

Gets the raw JSON string from the request.

Return Value

string The raw JSON string from the request.