PHPackages                             libero/content-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. [API Development](/categories/api)
4. /
5. libero/content-negotiation-bundle

AbandonedArchivedSymfony-bundle[API Development](/categories/api)

libero/content-negotiation-bundle
=================================

Adds content negotiation to your Symfony application

v0.1.0(7y ago)068411MITPHPPHP ^7.2

Since Dec 7Pushed 7y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (13)Versions (3)Used By (1)

ContentNegotiationBundle
========================

[](#contentnegotiationbundle)

[![Build Status](https://camo.githubusercontent.com/00106ca7b3dc89ecfe0b290294440f6204e283ea1151dca4b49151dd03244b37/68747470733a2f2f7472617669732d63692e636f6d2f6c696265726f2f636f6e74656e742d6e65676f74696174696f6e2d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/libero/content-negotiation-bundle)

This is a [Symfony](https://symfony.com/) bundle that will add [content negotiation](https://tools.ietf.org/html/rfc7231#section-5.3) to your application by integrating the [Negotiation library](https://github.com/willdurand/Negotiation).

Getting started
---------------

[](#getting-started)

Using [Composer](https://getcomposer.org/) you can add the bundle as a dependency:

```
composer require libero/content-negotation-bundle

```

If you're not using [Symfony Flex](https://symfony.com/doc/current/setup/flex.html), you'll need to enable the bundle in your application.

### Path-based negotiation

[](#path-based-negotiation)

You can add negotiation to paths through configuration.

For example, to add a requirement of XML or JSON and English or French to an exact path, and plain text and German elsewhere:

```
content_negotiation:
    formats:
        - path: ^/path/to/my/page$
          priorities: xml|json
        - path: ^/
          priorities: txt
    locales:
        - path: ^/path/to/my/page$
          priorities: en|fr
        - path: ^/
          priorities: de
```

The `formats` and `locales` items are run in order. The first to match will be used.

`priorities` may be empty, allowing for negotiation to be disabled at lower levels. For example, require English everywhere except under `/foo`:

```
content_negotiation:
    formats:
        - path: ^/foo($|/)
          priorities:
        - path: ^/
          priorities: en
```

`optional` may be set to `true` to allow falling back to subsequent matches. For example, to require English everywhere except under `/foo`, where either German or English is allowed:

```
content_negotiation:
    formats:
        - path: ^/foo($|/)
          priorities: de
          optional: true
        - path: ^/
          priorities: en
```

### Route-level negotiation

[](#route-level-negotiation)

You can add negotiation at the route level by adding requirements for `_format` and/or `_locale`.

These requirements must be a list of possibilities separated by vertical bars.

For example, to add a requirement of XML or JSON and English or French to a route:

```
my_route:
    path: /path/to/my/page
    controller: App\Controller\PageController
    requirements:
        _format: xml|json
        _locale: en|fr
```

Route-level negotiation takes precedence over path-based.

Getting help
------------

[](#getting-help)

- Report a bug or request a feature on [GitHub](https://github.com/libero/libero/issues/new/choose).
- Ask a question on the [Libero Community Slack](https://libero-community.slack.com/).
- Read the [code of conduct](https://libero.pub/code-of-conduct).

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

2715d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e6aaeba393e9038b5a5a916e5f4e32ffb349436e3be2027be4828f486bc8c9d?d=identicon)[thewilkybarkid](/maintainers/thewilkybarkid)

---

Top Contributors

[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (5 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/storefront

Storefront for Shopware

684.2M148](/packages/shopware-storefront)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)[sulu/headless-bundle

Bundle that provides controllers and services for using Sulu as headless content management system

55133.7k2](/packages/sulu-headless-bundle)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)

PHPackages © 2026

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