承接 zpetr/apigility-routeaccept 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zpetr/apigility-routeaccept

Composer 安装命令:

composer require zpetr/apigility-routeaccept

包简介

Routing based on Accept header for Apigility

README 文档

README

Routing based on Accept header of request

This module give you possibility to have any number of APIs with the same 'route' name.

Example:

Imagine that you have API car and API moto. If you create route named brand for both APIs, apigility will redirect you always to the last one. RouteAccept module offer a possibility to use API which correspond to the Accept Header.

So,

  • request to /brand with Accept header "application/vnd.car.v1+json" will give you something like:
{
    "brand": [
		{
			"id": 1,
			"name": "BMW"
		},
		{
			"id": 2,
			"name": "Ford"
		},
		...
	]
}
  • request to /brand with Accept header "application/vnd.moto.v1+json" will give you something like:
{
    "brand": [
		{
			"id": 1,
			"name": "Harley-Davidson"
		},
		{
			"id": 2,
			"name": "Kawasaki"
		},
		...
	]
}

Installation

Install composer in your project

curl -s http://getcomposer.org/installer | php

Define dependencies in your composer.json file

{
    "require": {
        "zpetr/apigility-routeaccept" : "1.*"
    }
}

Finally install dependencies

php composer.phar install

or update it

php composer.phar update

Usage

  • Add zPetr\RouteAccept to config/modules.config.php:
	return array(
    	'modules' => array(
        	...,
            'zPetr\\RouteAccept',
            ....
		)
	)     
  • Create APIs and routes (you can use the same names for different routes now)
  • Use it!

统计信息

  • 总下载量: 509
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-09-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固