Smalldb-REST  v0.5
Static Public Member Functions | List of all members
JsonResponse Class Reference

Description

Send well-formated JSON response.

Static Public Member Functions

static sendData ($response_data)
 Send response data when everything is ok. More...
 
static sendException (\Exception $ex)
 Send info about thrown exception and set proper HTTP code. More...
 
static writeException (\Exception $ex)
 Render exception as JSON string. More...
 
static writeJson ($json_data)
 Convert data to JSON and send them to client. More...
 

Member Function Documentation

static sendData (   $response_data)
static

Send response data when everything is ok.

static sendException ( \Exception  $ex)
static

Send info about thrown exception and set proper HTTP code.

static writeException ( \Exception  $ex)
static

Render exception as JSON string.

static writeJson (   $json_data)
static

Convert data to JSON and send them to client.