jder/psr
最新稳定版本:0.1.0
Composer 安装命令:
composer require jder/psr
包简介
A response builder for PSR
关键字:
README 文档
README
A response builder for PSR.
This package includes different response builders based on the JSON response structure specified in JSON Data Errors Response (JDER). With the builders, various kinds of responses can be created easily instead of sending plain text responses.
Installation
Install this package as a dependency in the project:
composer require jder/psr
Quick Start
To create a JSON response, use the following code:
use Psr\Http\Message\ServerRequestInterface as Request; use Psr\Http\Message\ResponseInterface as Response; use Jder\Psr\Json\CreateJsonResponse; function route( Request $request, Response $response, ): Response { return CreateJsonResponse::success($response)->create(); }
And the response will be shown as below:
{
"success": true,
"data": null,
"errors": []
}
Documentation
For the documentation,please refer to the documentation.
Contributing
For contributing, please refer to the contributing guide.
License
This project is licensed under the terms of the MIT license.
统计信息
- 总下载量: 1
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-16