PHPackages                             rollerworks/breadcrumbs-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. rollerworks/breadcrumbs-bundle

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

rollerworks/breadcrumbs-bundle
==============================

Easy breadcrumbs navigation for Symfony powered applications (Not the Symfony FrameworkBundle)

v0.1.4(8y ago)313.4k2[1 PRs](https://github.com/rollerworks-graveyard/breadcrumbs-bundle/pulls)MITPHPPHP ^5.5 || ^7.0

Since Mar 11Pushed 7y agoCompare

[ Source](https://github.com/rollerworks-graveyard/breadcrumbs-bundle)[ Packagist](https://packagist.org/packages/rollerworks/breadcrumbs-bundle)[ RSS](/packages/rollerworks-breadcrumbs-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (7)Versions (6)Used By (0)

RollerworksBreadcrumbsBundle
============================

[](#rollerworksbreadcrumbsbundle)

Easy breadcrumbs navigation for Symfony powered applications.

Requirements
------------

[](#requirements)

You need at least PHP 5.5.

This package requires the Symfony HTTPKernel component and can be used in any Symfony powered application (including the Symfony full stack framework) as long as the Symfony DependencyInjection component is used for dependency injection.

Which means you can use it without requiring the Symfony FrameworkBundle.

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

[](#installation)

To install this package, add `rollerworks/breadcrumbs-bundle` to your composer.json

```
$ php composer.phar require rollerworks/breadcrumbs-bundle
```

Now, [Composer](https://getcomposer.org/) will automatically download all required files, and install them for you.

### Enable the Bundle

[](#enable-the-bundle)

**Note:**

> This package is designed for Symfony powered applications, while not requiring the Symfony FrameworkBundle. It's expected you know enough about Symfony to somehow enable the bundle in your application. You should have at least the `request_stack` and `service_container`services registered and auto loading set-up.

Installation instructions shown here are limited to usage "with" the [Symfony-standard](https://github.com/symfony/symfony-standard/)distribution.

After running Composer enable the `RollerworksBreadcrumbsBundle` in your kernel:

```

```

Or if you prefer YAML

```
services:
    acme.breadcrumbs.customer:
        class: "Acme\Customer\CustomerBreadcrumbsProvider"
        tags: [ { name: rollerworks_breadcrumb.provider } ]
```

That's it, the `acme_customer_home` breadcrumb is now available for loading.

**Tip:** You can also load the breadcrumb by the route, so you don't have to configure the breadcrumb for every template. Simple get the current route-name by the request information.

The breadcrumb method must return an array, but you can decide which keys and values you want to use 👍

By convention it's recommended to at least return a label and route. When the `route` key is missing it will automatically be set by the `route` value of the annotation.

### Extra parameters

[](#extra-parameters)

It's possible to pass additional attributes with an annotation:

`@Breadcrumb(name="acme_customer_home", route="acme_customer_home", route_parameters={"foo"="bar"})`

The `route_parameters` attribute is available using `$breadcrumb['extra']['route_parameters']`.

You can use any value or type you want.

**Note:** When you pass the `extra` attribute to annotation it must be an array! And it will overwrite all other extra parameters.

### Breadcrumb parents trail

[](#breadcrumb-parents-trail)

Breadcrumbs don't consist of just one, they form a trail to there origin. Fortunately the RollerworksBreadcrumbsBundle provides a very powerful and easy way to create breadcrumb trails.

All you need to do is add the `parent` attribute to annotation:

```
@Breadcrumb(name="acme_customer_home", route="acme_customer_home", parent="acme_homepage")

```

The `parent` value must point to another breadcrumb that you want to use a parent. In this example you would get something like `Home > Account`.

But when `acme_homepage` also has a parent your trail might look something like: `Acme > Home > Account`.

**Note:** It doesn't matter if the parent is registered later then the current breadcrumb, all breadcrumbs are collected during the container compiling process, and then there trails are computed.

There is no limit on the number of parents, but a parent cannot reference a breadcrumb that is already in the trail, so this will not work: ``Acme &gt; Home &gt; Account &gt; Acme`, as it would result in an endless loop.

### Base configuration

[](#base-configuration)

When define breadcrumbs in a provider, there is a big chance they share a common or base configuration. For example all or the majority starts with the same name/route prefix or have the same parent.

Instead of copying or retyping this all by hand there is an easier solution:

```
namespace Acme\Customer;

use Rollerworks\Bundle\BreadcrumbsBundle\Annotation\BreadcrumbProvider;
use Rollerworks\Bundle\BreadcrumbsBundle\Annotation\Breadcrumb;
use Symfony\Component\HttpFoundation\Request;

/**
 * @BreadcrumbProvider(namePrefix="acme_customer.", routePrefix="acme_customer_", parent="app_homepage")
 */
class CustomerBreadcrumbsProvider
{
    /**
     * @Breadcrumb(name="home", route="home")
     */
    public function home(Request $request, array $breadcrumb)
    {
        return [
            'label' => 'Account',
            'route' => $breadcrumb['route'],
        ];
    }

    /**
     * @Breadcrumb(name="edit", route="edit")
     */
    public function edit(Request $request, array $breadcrumb)
    {
        return [
            'label' => 'Account',
            'route' => $breadcrumb['route'],
        ];
    }
}
```

The `@BreadcrumbProvider` annotation will set the base configuration for all the breadcrumbs in the class. So the breadcrumb of method `home` will be become `@Breadcrumb(name="acme_customer.home", route="acme_customer_home", parent="app_homepage")`.

And the same goes for the `edit` method.

But if you don't need this for all methods (or not all attributes) you can still overwrite the configuration per breadcrumb:

```
namespace Acme\Customer;

use Rollerworks\Bundle\BreadcrumbsBundle\Annotation\BreadcrumbProvider;
use Rollerworks\Bundle\BreadcrumbsBundle\Annotation\Breadcrumb;
use Symfony\Component\HttpFoundation\Request;

/**
 * @BreadcrumbProvider(namePrefix="acme_customer.", routePrefix="acme_customer_", parent="app_homepage")
 */
class CustomerBreadcrumbsProvider
{
    /**
     * @Breadcrumb(name="home", route="home")
     */
    public function home(Request $request, array $breadcrumb)
    {
        return [
            'label' => 'Account',
            'route' => $breadcrumb['route'],
        ];
    }

    /**
     * @Breadcrumb(name="edit", route="edit")
     */
    public function edit(Request $request, array $breadcrumb)
    {
        return [
            'label' => 'Account',
            'route' => $breadcrumb['route'],
        ];
    }

    /**
     * @Breadcrumb(fullName="acme_customer.group_list", fullRoute="acme_group_list", parent="")
     */
    public function listGroups(Request $request, array $breadcrumb)
    {
        return [
            'label' => 'Account',
            'route' => $breadcrumb['route'],
        ];
    }
}
```

Now the `listGroups` method will ignore the the base configuration, and use only it's own.

**Note:** The `extra` attribute will overwrite the inherited extra information.

### Multiple `@Breadcrumb` annotations

[](#multiple-breadcrumb-annotations)

If your breadcrumbs are very static, eg. only a route, label and some extra information you can also use a single method for multiple breadcrumbs.

```
namespace Acme\Customer;

use Rollerworks\Bundle\BreadcrumbsBundle\Annotation\BreadcrumbProvider;
use Rollerworks\Bundle\BreadcrumbsBundle\Annotation\Breadcrumb;
use Symfony\Component\HttpFoundation\Request;

/**
 * @BreadcrumbProvider(namePrefix="acme_customer.", routePrefix="acme_customer_", parent="app_homepage")
 */
class CustomerBreadcrumbsProvider
{
    /**
     * @Breadcrumb(name="acme_customer.home", route="home", label="Account")
     * @Breadcrumb(name="acme_customer.edit", route="edit", label="Edit", parent="acme_customer.home")
     */
    public function action(Request $request, array $breadcrumb)
    {
        return [
            'label' => $breadcrumb['extra']['label'],
            'route' => $breadcrumb['route'],
        ];
    }
}
```

The `action` method will be called for every breadcrumb, but with different data.

### Special notes

[](#special-notes)

The class and method names are unimportant, you can use anything you like. But methods must be declared `public`. Arguments are not required.

The `$request` provides information about the current request.

The `$breadcrumb` argument provides the normalized information of the breadcrumb:

- name: Name of the breadcrumb.
- parent: Parent of the breadcrumb (null when empty).
- class: Full qualified class-name of the breadcrumbs provider.
- service: The service-id of the breadcrumbs provider.
- method: Method name of the provider (basically the current method).
- extra: All extra attributes provided to the Annotation as an array.
- trail: The breadcrumb trail from root to current, all values are breadcrumb names.

#### Arguments with container parameters

[](#arguments-with-container-parameters)

All parameter values (including extra parameters) are resolved by the ServiceContainer's parameter-bag. Value `%somevar%` will be replaced with the container parameter value of `%somevar%`.

Only string values are accepted for non-extra parameters.

**Note:** Array values are resolved recursively, meaning all deeper levels are are also resolved.

To use percent sign as-is in a parameter or attribute, it must be escaped with another percent sign: `foo%%somevar%%bar`.

See also:

[https://symfony.com/doc/current/components/dependency\_injection/parameters.html](https://symfony.com/doc/current/components/dependency_injection/parameters.html)[https://symfony.com/doc/current/book/service\_container.html#service-parameters](https://symfony.com/doc/current/book/service_container.html#service-parameters)

Versioning
----------

[](#versioning)

For transparency and insight into the release cycle, and for striving to maintain backward compatibility, this package is maintained under the Semantic Versioning guidelines as much as possible.

Releases will be numbered with the following format:

`..`

And constructed with the following guidelines:

- Breaking backward compatibility bumps the major (and resets the minor and patch)
- New additions without breaking backward compatibility bumps the minor (and resets the patch)
- Bug fixes and misc changes bumps the patch

For more information on SemVer, please visit .

License
-------

[](#license)

The package is provided under the [MIT license](LICENSE).

###  Health Score

30

—

LowBetter than 65% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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 ~154 days

Total

5

Last Release

3094d ago

PHP version history (2 changes)v0.1.0PHP &gt;=5.5

v0.1.4PHP ^5.5 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f0e812c04e848e9cc3afe6e966d2b81e81308124d96ce5f54eff4db0f8db0ea9?d=identicon)[sstok](/maintainers/sstok)

---

Top Contributors

[![sstok](https://avatars.githubusercontent.com/u/904790?v=4)](https://github.com/sstok "sstok (27 commits)")

---

Tags

breadcrumbsbundlesymfonysymfony-bundle

### Embed Badge

![Health badge](/badges/rollerworks-breadcrumbs-bundle/health.svg)

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

###  Alternatives

[pentatrion/vite-bundle

Vite integration for your Symfony app

2725.3M13](/packages/pentatrion-vite-bundle)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[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)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[open-dxp/opendxp

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

7310.3k29](/packages/open-dxp-opendxp)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)

PHPackages © 2026

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