PHPackages                             zpetr/apigility-routeaccept - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. zpetr/apigility-routeaccept

ActiveLibrary[API Development](/categories/api)

zpetr/apigility-routeaccept
===========================

Routing based on Accept header for Apigility

1.0.3(5y ago)1500↓100%1MITPHPPHP &gt;=5.3.23

Since Feb 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/zpetr/apigility-routeaccept)[ Packagist](https://packagist.org/packages/zpetr/apigility-routeaccept)[ Docs](https://github.com/zpetr/apigility-routeaccept)[ RSS](/packages/zpetr-apigility-routeaccept/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

apigility-routeaccept
=====================

[](#apigility-routeaccept)

Routing based on Accept header of request

---

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

### Example:

[](#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

[](#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

[](#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!

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~263 days

Total

4

Last Release

1854d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f33f8f73652e2ddb1fa9c7b7c3e2c61fc71088b99f79a5c5aff635442590dc80?d=identicon)[zpetr](/maintainers/zpetr)

---

Top Contributors

[![zpetr](https://avatars.githubusercontent.com/u/2429147?v=4)](https://github.com/zpetr "zpetr (16 commits)")[![pgl-az](https://avatars.githubusercontent.com/u/71706060?v=4)](https://github.com/pgl-az "pgl-az (4 commits)")[![Eliot-az](https://avatars.githubusercontent.com/u/107464519?v=4)](https://github.com/Eliot-az "Eliot-az (1 commits)")

---

Tags

apiheaderacceptmodulezf2routeapigility

### Embed Badge

![Health badge](/badges/zpetr-apigility-routeaccept/health.svg)

```
[![Health](https://phpackages.com/badges/zpetr-apigility-routeaccept/health.svg)](https://phpackages.com/packages/zpetr-apigility-routeaccept)
```

###  Alternatives

[nezamy/route

Route - Fast, flexible routing for PHP, enabling you to quickly and easily build RESTful web applications.

21436.6k5](/packages/nezamy-route)[evandotpro/edp-github

Github API integration module for Zend Framework 2

241.6k](/packages/evandotpro-edp-github)[narno/gandi-api

Simple PHP library for the Gandi API.

1622.3k](/packages/narno-gandi-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
