somephp / jsonresponse
Create and send a RESTful JSON response.
dev-master
2017-07-30 20:12 UTC
Requires
- php: >=4.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-09-06 23:33:01 UTC
README
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.
License
MIT - MIT License File: LICENSE
Examples
<?php
$resp = new JSONResponse();
$resp->data[] = 'one';
$resp->data[] = 'two';
$resp->send();
Installation
Composer
composer require somephp/jsonresponse
Contents
| Resource | Description |
|---|---|
Contributions
Suggestions and code modifications are welcome. Create a merge request, and tell me what are thinking.