PHPackages                             elseym/content-type-negotiation-bundle - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. elseym/content-type-negotiation-bundle

AbandonedArchivedSymfony-bundle[HTTP &amp; Networking](/categories/http)

elseym/content-type-negotiation-bundle
======================================

Enables Symfony2 apps to serve different content types under the same URI based on the HTTP Accept header.

013PHP

Since Nov 23Pushed 13y ago1 watchersCompare

[ Source](https://github.com/elseym/content-type-negotiation-bundle)[ Packagist](https://packagist.org/packages/elseym/content-type-negotiation-bundle)[ RSS](/packages/elseym-content-type-negotiation-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Symfony 2 Content Type Negotiation Bundle
-----------------------------------------

[](#symfony-2-content-type-negotiation-bundle)

This bundle can be used to enable a simple content type negotiation in Symfony2 applications. To use it, just include it as a dependency in your composer.json and register the bundle in your AppKernel:

`composer.json`:

```
...
"require": {
	...
	"elseym/content-type-negotiation-bundle": "dev-master"
}
...

```

`app/AppKernel.php`:

```
...
$bundles = array(
	...
	new elseym\ContentTypeNegotiationBundle\elseymContentTypeNegotiationBundle(),
	...
);

```

### Usage

[](#usage)

The key component of this bundle is an `EventListener` that registeres for `kernel.controller` events and selects the best suitable controller action for each request. This decision is based on the value of a requests `Accept` header.

For a request with an `Accept` header like this:

```
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8

```

The bundle would try to use one the following controller actions:

- indexActionHtmlText
- indexActionHtml
- indexActionXhtmlXmlApplication
- indexActionXhtmlXml
- indexActionXmlApplication
- indexActionXml
- indexAction

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7d576bda5c70255f203244318b1b634fb94131d5ce94becb13ae39f583f3a492?d=identicon)[PSeiffert](/maintainers/PSeiffert)

![](https://www.gravatar.com/avatar/29d269dd411b0130a1635dc9c2df84f67065f6cb6bbefa1ed59ad95b88c85d2c?d=identicon)[elseym](/maintainers/elseym)

---

Top Contributors

[![elseym](https://avatars.githubusercontent.com/u/907478?v=4)](https://github.com/elseym "elseym (3 commits)")[![SimonSimCity](https://avatars.githubusercontent.com/u/392589?v=4)](https://github.com/SimonSimCity "SimonSimCity (1 commits)")

### Embed Badge

![Health badge](/badges/elseym-content-type-negotiation-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/elseym-content-type-negotiation-bundle/health.svg)](https://phpackages.com/packages/elseym-content-type-negotiation-bundle)
```

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25025.5M80](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.2M6.6k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k20.0k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87930.4k113](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.3M84](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69122.6k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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