mikes/json-response
Composer 安装命令:
composer require mikes/json-response
包简介
A simple class that returns JSON response with HTTP status
README 文档
README
A simple class that returns a formatted json response
Installation
composer require mikes/json-response
<?php require __DIR__ . "/vendor/autoload.php"; use mikesjsonresponse\ResponseClass\JsonResponse; $student = array( 'name' => 'John Smith', 'course' => 'Maths', 'level' => '101', 'collections' => ['books' => 'Intro to UML', 'music' => 'rap'] ); new JsonResponse('unauthorized', '', $student);
Param 1 (required)
- success or ok - 200 http status
- unauthorizsed - 401 http status
- exception - 500 http status
Param 2 (optional)
string - the return message, leave empty if not available
param 3 (optional)
array - an array of data
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-24