PHPackages                             asprega/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. asprega/breadcrumb-bundle

Abandoned → [slope-it/breadcrumb-bundle](/?search=slope-it%2Fbreadcrumb-bundle)ArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

asprega/breadcrumb-bundle
=========================

A bundle for generating dynamic breadcrumbs in Symfony applications

0.6.0(5y ago)1571.4k↓24.3%3MITPHPPHP &gt;=7.2.0

Since Aug 11Pushed 5y ago2 watchersCompare

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

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

AndreaSpregaBreadcrumbBundle
============================

[](#andreaspregabreadcrumbbundle)

### WARNING: This bundle has been renamed and transferred to

[](#warning-this-bundle-has-been-renamed-and-transferred-to-httpsgithubcomslope-itbreadcrumb-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/aec6e83c38c045151892f04a65536b71098e1d7c375e60afa61615a7f55e292c/68747470733a2f2f706f7365722e707567782e6f72672f617370726567612f62726561646372756d622d62756e646c652f762f737461626c65)](https://packagist.org/packages/asprega/breadcrumb-bundle)[![Total Downloads](https://camo.githubusercontent.com/195e76260ca257a64b525c5afcdcd97b3dc7fead57b776999018ca3c1c2389f1/68747470733a2f2f706f7365722e707567782e6f72672f617370726567612f62726561646372756d622d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/asprega/breadcrumb-bundle)[![License](https://camo.githubusercontent.com/a9f7ca63165e3df446f167b29ad5c1b16cf5a0438b7664dbb6532ba4a9bc34ec/68747470733a2f2f706f7365722e707567782e6f72672f617370726567612f62726561646372756d622d62756e646c652f6c6963656e7365)](https://packagist.org/packages/asprega/breadcrumb-bundle)[![SensioLabsInsight](https://camo.githubusercontent.com/61d9730b40a8c2fae75ed447dc35c94941349ec339189b56c2334c91d1697305/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37663133383137612d333736352d343266352d626563622d3039393061313231396533392f6d696e692e706e67)](https://insight.sensiolabs.com/projects/7f13817a-3765-42f5-becb-0990a1219e39)

This bundle provides a way to create "dynamic" breadcrumbs in your Symfony applications.

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

[](#installation)

Composer is the only supported installation method. Run the following to install the latest version from Packagist:

```
composer require asprega/breadcrumb-bundle
```

Or, if you prefer, you can require any version in your `composer.json`:

```
{
    "require": {
        "asprega/breadcrumb-bundle": "*"
    }
}
```

*NOTE:* Until the bundle reaches version 1.0.0 I can't guarantee to follow [semantic versioning](http://semver.org) strictly.

Usage
-----

[](#usage)

### 1. Load bundle

[](#1-load-bundle)

Once installed, load the bundle in your Kernel class:

```
// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...
            new AndreaSprega\Bundle\BreadcrumbBundle\AndreaSpregaBreadcrumbBundle(),
        );
        // ...
    }
    // ...
}
```

### 2. Define breadcrumbs

[](#2-define-breadcrumbs)

There are two ways to create a breadcrumb: via code (1) or via annotations (2).

*Via code*: you can retrieve the breadcrumb builder in your controller and add breadcrumb items:

```
public function coolStuffAction()
{
    // ...

    $builder = $this->get('asprega.breadcrumb.builder');
    $builder->addItem('home', 'home_route');
    $builder->addItem('$entity.property', 'entity_route');
    $builder->addItem('cool_stuff');

    // ...
}
```

*Via annotations*: just use the `@Breadcrumb` annotation at the class and/or method level. They will be merged (class comes first).

*NOTE:* The annotation can take either a single item (in the above example it's done at the class level) or multiple items (at the method level).

```
