MODE_JSON
MODE_JSON
ApiResponseProvider is a base class for sendig information in proper format to end user.
Derived classes mainly need to implement two methods: {@link sendData} and {@link accessDenied}.
sendData(array $data, int $status, array $headers)
Function converts $data array to appropriate format, sends it to client and terminates the application.
Usage example:
$this->sendData( array(...), 200, array( "Content-Range: items $offset-$limit/$total", ... ) );
array | $data | |
int | $status | code. |
array | $headers | http headers array. |