somephp/jsonresponse

创建并发送 RESTful JSON 响应。

安装: 9

依赖关系: 0

建议者: 0

安全性: 0

星星: 0

分支: 0

类型:项目

dev-master 2017-07-31 03:12 UTC

This package is not auto-updated.

Last update: 2024-09-22 14:06:29 UTC


README

返回一个 RESTFull JSON 响应。响应体包含 3 个属性。

  • data: 请求结果。
  • error: 错误信息。例如:[{code: 555, msg: 'No results Found'}]
  • meta: 关于响应的元信息。

许可证

MIT - MIT 许可证文件:LICENSE

示例

<?php
$resp = new JSONResponse();
$resp->data[] = 'one';
$resp->data[] = 'two';
$resp->send();

安装

Composer

composer require somephp/jsonresponse

内容

资源描述

贡献

欢迎提出建议和代码修改。创建合并请求,并告诉我你的想法。