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 ago2 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 1mo 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 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community11

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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M317](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M292](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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