Return a RESTFull JSON response. The response body contains 3 properties.
- data: request results.
- error: error information. ex.[{code: 555, msg: 'No results Found'}]
- meta: meta information about the response.
MIT - MIT License File: LICENSE
<?php
$resp = new JSONResponse();
$resp->data[] = 'one';
$resp->data[] = 'two';
$resp->send();
composer require somephp/jsonresponse
Resource | Description |
---|---|
Suggestions and code modifications are welcome. Create a merge request, and tell me what are thinking.