Json_Response Class Reference

Inheritance diagram for Json_Response:
Json_Error Json_Exception

Public Member Functions

 __construct ($body, $type=self::SUCCESS)
 toJson ()

Data Fields

const SUCCESS = 'success'
const ERROR = 'error'

Protected Attributes

 $type
 $body

Detailed Description

JSON Response

Definition at line 23 of file ajax.lib.php.


Constructor & Destructor Documentation

__construct ( body,
type = self::SUCCESS 
)
Parameters:
mixed $body
string $type Json_Response::SUCCESS (default) or Json_Response::ERROR

Definition at line 42 of file ajax.lib.php.


Member Function Documentation

toJson (  ) 

Get JSON code for the response

Returns:
string JSON code (utf-8 encoded)

Definition at line 52 of file ajax.lib.php.


Field Documentation

$body [protected]

Definition at line 35 of file ajax.lib.php.

$type [protected]

Definition at line 35 of file ajax.lib.php.

const ERROR = 'error'

Message type ERROR

Definition at line 33 of file ajax.lib.php.

const SUCCESS = 'success'

Message type SUCCESS

Definition at line 28 of file ajax.lib.php.


The documentation for this class was generated from the following file:
Generated on Tue Jun 8 12:28:39 2010 for Claroline API by  doxygen 1.6.3