Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/m-adamski/symfony-breadcrumbs-bundle

The Symfony Bundle, which simplifies the process of generating and displaying breadcrumbs
https://github.com/m-adamski/symfony-breadcrumbs-bundle

breadcrumbs-bundle php symfony symfony-bundle

Last synced: about 2 months ago
JSON representation

The Symfony Bundle, which simplifies the process of generating and displaying breadcrumbs

Awesome Lists containing this project

README

        

# Breadcrumbs Bundle for Symfony

The Symfony Bundle, which simplifies the process of generating and displaying breadcrumbs.
Compared to previous versions, this one is based on simple methods of creating and adding breadcrumbs.

Package ``symfony/translation`` is no longer required. If you would like to translate breadcrumbs, do it in the
template.

Version 5.0 doesn't have compatibility with previous versions.

## Installation

Composer can install this bundle:

```
$ composer require m-adamski/symfony-breadcrumbs-bundle
```

## How to use it?

```php
use Adamski\Symfony\BreadcrumbsBundle\Helper\BreadcrumbsHelper;
use Adamski\Symfony\BreadcrumbsBundle\Model\Breadcrumb;

$this->breadcrumbHelper
->add((new Breadcrumb("Dashboard"))->setRoute("dashboard"))
->add((new Breadcrumb("Users"))->setRoute("user"));
```

The custom Twig function is responsible for displaying breadcrumbs:

```(html)

{{ breadcrumbs() }}

```

## License

MIT