dev-master
9999999-dev https://github.com/zpetr/apigility-routeacceptRouting based on Accept header for Apigility
BSD
The Requires
by Petr Glushchenko
api zf2 route module apigility accept header
Routing based on Accept header for Apigility
Routing based on Accept header of request, (*1)
This module give you possibility to have any number of APIs with the same 'route' name., (*2)
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., (*3)
So,, (*4)
{ "brand": [ { "id": 1, "name": "BMW" }, { "id": 2, "name": "Ford" }, ... ] }
{ "brand": [ { "id": 1, "name": "Harley-Davidson" }, { "id": 2, "name": "Kawasaki" }, ... ] }
Install composer in your project, (*5)
curl -s http://getcomposer.org/installer | php
Define dependencies in your composer.json file, (*6)
{ "require": { "zpetr/apigility-routeaccept" : "1.*" } }
Finally install dependencies, (*7)
php composer.phar install
or update it, (*8)
php composer.phar update
return array( 'modules' => array( ..., 'zPetr\\RouteAccept', .... ) )
Routing based on Accept header for Apigility
BSD
api zf2 route module apigility accept header