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(9mo ago)03MITPHPCI passing

Since Sep 11Pushed 9mo 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 today

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

27

—

LowBetter than 47% of packages

Maintenance56

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

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

295d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/63095040?v=4)[AYRAULT Kévin](/maintainers/k-ayrault)[@k-ayrault](https://github.com/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

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[sylius/sylius

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

8.5k5.9M738](/packages/sylius-sylius)[oro/platform

Business Application Platform (BAP)

645143.5k115](/packages/oro-platform)[contao/core-bundle

Contao Open Source CMS

1231.6M2.8k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[pimcore/pimcore

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

3.8k3.8M508](/packages/pimcore-pimcore)

PHPackages © 2026

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