$layout
$layout
This is the base API controller class.
setResponseProvider(\ApiResponseProvider $responseProvider)
| \ApiResponseProvider | $responseProvider |
sendJson(array $data, int $status, array $headers) : null
Function convert $data array to json string, sends it to client and terminates the application.
Usage example:
$this->sendJson(
array(...),
200,
array(
"Content-Range: items $offset-$limit/$total",
...
)
);
| array | $data | |
| int | $status | code. |
| array | $headers | http headers array. |
sendData(array $data, integer $status, array $headers)
Function send data to end user and terminate the application.
Format of data defined based on {@link responseProvider}
| array | $data | Data to be sent |
| integer | $status | Status code (e.g. 200 or 403) |
| array | $headers | List of additional headers to use when sending an response |
| todo |
|---|