Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m-adamski/symfony-breadcrumbs-bundle
Bundle for Symfony, 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: 26 days ago
JSON representation
Bundle for Symfony, which simplifies the process of generating and displaying breadcrumbs
- Host: GitHub
- URL: https://github.com/m-adamski/symfony-breadcrumbs-bundle
- Owner: m-adamski
- License: mit
- Created: 2018-10-22T09:30:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-02-02T10:22:59.000Z (9 months ago)
- Last Synced: 2024-09-11T21:42:30.153Z (about 2 months ago)
- Topics: breadcrumbs-bundle, php, symfony, symfony-bundle
- Language: PHP
- Homepage:
- Size: 30.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Breadcrumbs Bundle for Symfony
The Breadcrumbs tool simplifies the generation and display process of breadcrumbs.
This bundle is compatible with Symfony 4.1 and Symfony 5.0. Symfony 3.4 compatibility abandoned.
## Installation
This bundle can be installed by Composer:
```
$ composer require m-adamski/symfony-breadcrumbs-bundle
```## How to use it?
In the controller action, generate the breadcrumbs structure:
```(php)
$this->breadcrumbsHelper->addRouteItem("Management", "administrator.index", [], "navigation");
$this->breadcrumbsHelper->addRouteItem("Data management", "administrator.data", ["id" => $id], "navigation");
```To display breadcrumbs in Twig template file use breadcrumbs() function:
```(html)
{{ breadcrumbs() }}
```
## Creating a breadcrumbs structure
To manage the breadcrumbs structure additional functions have been implemented.
| Method | Description |
| ----------------------- | ------------------------------------------------------------------------------- |
| addItem | Add breadcrumb item at the end of default namespace collection |
| addRouteItem | Add the route breadcrumb item, at the end of default namespace collection |
| addNamespaceItem | Add breadcrumb item at the end of specified namespace collection |
| prependItem | Add breadcrumb item at the beginning of default namespace collection |
| prependRouteItem | Add the route breadcrumb item, at the beginning of default namespace collection |
| prependNamespaceItem | Add breadcrumb item at the beginning of specified namespace collection |
| clear | Clear specified or all namespaces collections |
| getNamespaceBreadcrumbs | Return breadcrumbs from specified namespace |## License
MIT