krak/api
最新稳定版本:v0.6.1
Composer 安装命令:
composer require krak/api
包简介
A library used for developing RESTful Apis
README 文档
README
A framework designed for building apis using the Symfony HttpKernel
Installation
Installation via composer:
{
"require": {
"krak/api": "^0.6"
}
}
Event Listener
The Event Listener holds an option ViewListener that will take the result of your controllers and use an http converter to convert them into a proper response.
HttpConverter
Converts and formats an Api Response into a HTTP Response in the proper format.
Response
A response is the vehicle for your api data. The Response holds the status type and builds an extra headers or status information around the data.
ResponseMarshaler
Response Marshalers take a response and create the array data to be converted to an Http response.
Usage
ResponseMarshalers are attached to HttpConverters.
use Krak\Api\HttpConverter\JsonHttpConverter;
use Krak\Api\ResponseMarshaler\StatusResponseMarshaler;
$converter = new JsonHttpConverter();
$converter->setResponseMarshaler(new StatusResponseMarshaler());
StatusResponseMarshaler
The status response marshaler will add a status field to the response data
Todo
- Create marshalers and fix the Response object model
统计信息
- 总下载量: 189
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-07