SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Json

Methods for handling JSON output, usually for AJAX responses

Functions

NameVisibilityDescription
confirmpublic (static)Sends a JSON confirmation response, and then terminates.
errorpublic (static)Sends a JSON message which has the success field set to zero
outpublic (static)Outputs the JSON data (encoded) + correct mime type, then stops script execution

public confirm

void Json::confirm ( [ mixed $data ] );

Sends a JSON confirmation response, and then terminates.

The returned data will have the key 'success' => 1 added.
If no data is provided, the returned JSON will only contain the 'success' key.

This method halts execution

public error

void Json::error ( mixed $message );

Sends a JSON message which has the success field set to zero
and the specified message in the message field.

If $message is an Exception object, the message will be extracted
and if on the test server, a stacktrace is included as well.

This method halts execution

public out

void Json::out ( mixed $data [, int $options ] );

Outputs the JSON data (encoded) + correct mime type, then stops script execution