JsonResponse

JSON Response class.

This class serves to provide the Joomla Platform with a common interface to access response variables for e.g. Ajax requests.

since

3.1

Methods

__construct

Constructor

__construct(mixed $response = null, string $message = null, boolean $error = false, boolean $ignoreMessages = false) 
since

3.1

Arguments

$response

mixedThe Response data

$message

stringThe main response message

$error

booleanTrue, if the success flag shall be set to false, defaults to false

$ignoreMessages

booleanTrue, if the message queue shouldn't be included, defaults to false

__toString

Magic toString method for sending the response in JSON format

__toString() : string
since

3.1

Response

stringThe response in JSON format

Properties

success

Determines whether the request was successful

since

3.1

Type(s)

boolean

message

The main response message

since

3.1

Type(s)

string

messages

Array of messages gathered in the \JApplication object

since

3.1

Type(s)

array

data

The response data

since

3.1

Type(s)

mixed