PHPackages                             kayrault/breadcrumb-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. kayrault/breadcrumb-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

kayrault/breadcrumb-bundle
==========================

v1.0.0(8mo ago)03MITPHPCI passing

Since Sep 11Pushed 8mo agoCompare

[ Source](https://github.com/k-ayrault/breadcrumb-bundle)[ Packagist](https://packagist.org/packages/kayrault/breadcrumb-bundle)[ RSS](/packages/kayrault-breadcrumb-bundle/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (10)Versions (2)Used By (0)

Kayrault Breadcrumb Bundle
==========================

[](#kayrault-breadcrumb-bundle)

[![License: MIT](https://camo.githubusercontent.com/a7e65aee57b11d28e4caff8b945729a66be0bb663f7f93bd24c5aa65699f148e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Breadcrumb navigation management for Symfony applications.

This bundle provides a simple, flexible way to define and render breadcrumbs in Symfony 7.3+ using KnpMenu and Twig. It ships with a configuration system, ready‑to‑use templates, and translations to help you get productive quickly.

- Compatible with: Symfony 7.3+ and PHP 8.3+
- Depends on: symfony/framework-bundle, symfony/translation, twig/twig, knplabs/knp-menu-bundle

Installation
------------

[](#installation)

### 1) With Symfony Flex (recommended)

[](#1-with-symfony-flex-recommended)

```
composer require kayrault/breadcrumb-bundle
```

Flex will register this bundle and usually enable KnpMenuBundle, and wire services automatically.

Note: In some Symfony Flex setups, you may need to enable KnpMenuBundle manually in config/bundles.php (see the bundles.php snippet below).

### 2) Without Symfony Flex

[](#2-without-symfony-flex)

1. Require the packages: ```
    composer require kayrault/breadcrumb-bundle knplabs/knp-menu-bundle
    ```
2. Enable the bundles in config/bundles.php: ```
    return [
        // ...
        Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true],
        Kayrault\BreadcrumbBundle\KayraultBreadcrumbBundle::class => ['all' => true],
    ];
    ```

No additional service config is needed: the bundle ships its own service definitions and Twig path. The KnpMenuBundle must be enabled because this bundle registers its breadcrumb builder and renderer using KnpMenu services and tags.

Basic usage
-----------

[](#basic-usage)

The bundle exposes a KnpMenu builder and a renderer under the alias "kayrault\_breadcrumb".

- Menu builder service: Kayrault\\BreadcrumbBundle\\Menu\\BreadcrumbBuilder
- Renderer service: Kayrault\\BreadcrumbBundle\\Menu\\BreadcrumbRenderer (KnpMenu renderer alias: `kayrault_breadcrumb`)

1. Declare your breadcrumb items per route (see Configuration below).
2. Render the breadcrumb in Twig:

```
{# e.g. templates/base.html.twig #}
{% if app.request %}
    {{ knp_menu_render('kayrault_breadcrumb', {}, 'kayrault_breadcrumb') }}
{% endif %}
```

3. Include the stylesheet in your base layout so the breadcrumb renders with the default styles:

```
{# e.g. templates/base.html.twig, in your  block #}

```

This will use the bundle template `@KayraultBreadcrumb/menu/breadcrumb.html.twig` by default.

### Programmatic building

[](#programmatic-building)

This bundle focuses on configuration-driven breadcrumbs. If you need to build or manipulate menus programmatically, please use KnpMenuBundle directly (see  for documentation).

Configuration
-------------

[](#configuration)

Define your breadcrumbs per route under the `kayrault_breadcrumb` root key. Each route contains an `items` list. Each item can be translated and optionally linked to a route.

```
# config/packages/kayrault_breadcrumb.yaml
kayrault_breadcrumb:
  # Optional: configure the Home entry (added automatically as the first item)
  home_route: 'app_home'
  home_label: 'kayrault_breadcrumb.common.home'
  home_translatable: true
  home_translation_domain: 'KayraultBreadcrumbBundle'

  routes:
    app_dashboard:
      items:
        - { label: 'Dashboard', translatable: true, translation_domain: 'messages' }
    app_article_show:
      items:
        - { label: 'menu.articles', translatable: true, translation_domain: 'messages', route: 'app_article_index' }
        - label: 'article.show'
          translatable: true
          translation_domain: 'messages'
          translation_parameters:
            - { key: '%name%', value: 'Acme' }
```

Notes:

- The builder adds a "home" item by default. You can customize it with the `home_*` options above. If `home_translatable` is true, the label is translated using `home_translation_domain`.
- Item fields:
    - `label` (string, required)
    - `route` (string|null)
    - `translatable` (bool, default: true)
    - `translation_domain` (string|null, default: messages when translatable)
    - `translation_parameters` (list of key/value pairs)

### Assets and templates

[](#assets-and-templates)

- Default template: `@KayraultBreadcrumb/menu/breadcrumb.html.twig`
- Optional CSS provided at `public/assets/styles/breadcrumb.css` (publish or import in your asset pipeline if desired).

Documentation
-------------

[](#documentation)

Full documentation lives in the `docs/` folder of this repository. Start with `docs/` to explore advanced usage, template overrides, and customization.

Contributing
------------

[](#contributing)

Contributions are welcome! Please:

- Follow PSR-12 and Symfony coding standards.
- Run quality tools before opening a PR:
    - PHP Lint &amp; CS: `vendor/bin/php-cs-fixer fix --diff`
    - Twig CS: `vendor/bin/twig-cs-fixer lint templates --diff` (see )
    - Static analysis: `vendor/bin/phpstan analyse`
- Describe your change and include tests when applicable.

License
-------

[](#license)

This bundle is released under the MIT License. See the [LICENSE](LICENSE) file for details.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance61

Regular maintenance activity

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity35

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

243d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fa0568629d698ab7aa28e1e9f5909dfb7b19ab1a5517278be5457ee5a22e60d5?d=identicon)[k-ayrault](/maintainers/k-ayrault)

---

Top Contributors

[![k-ayrault](https://avatars.githubusercontent.com/u/63095040?v=4)](https://github.com/k-ayrault "k-ayrault (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/kayrault-breadcrumb-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/kayrault-breadcrumb-bundle/health.svg)](https://phpackages.com/packages/kayrault-breadcrumb-bundle)
```

###  Alternatives

[sylius/sylius

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

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

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3689.4k10](/packages/netgen-layouts-core)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)

PHPackages © 2026

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