mikamatto/breadcrumb-bundle

A Symfony bundle for managing breadcrumbs.

dev-main 2024-10-09 18:17 UTC

This package is auto-updated.

Last update: 2024-10-09 18:22:04 UTC


README

A Symfony bundle for managing breadcrumbs in your Symfony applications. My first bundle, so don't use it as it still sucks.

Installation

Use Composer to install the bundle:

composer require mikamatto/breadcrumb-bundle

### Breadcrumbs file input
The structure is read by default in a yaml file located at config/breadcrumbs.yaml

Or you can add a custom file using a yaml package configuration file:
    breadcrumb:
        breadcrumbs_file: '%kernel.project_dir%/config/breadcrumbs.yaml'

#### YAML Structure
Here's a sample structure of the breadcrumbs.yaml file:

app_contact:
  label: 'Contact Us'

app_account:
  label: 'Account Settings'
  parameters: 
    id: 'user.id'

app_profile:
  label: 'Profile'
  parameters: 
    id: 'user.id'
  chain: ['app_account']

Every block header is the route name. For every block we have the label to display in the breadcrumb, any route parameters, and a chain of routes.
Example, the route app_profile will generate: Account Settings > Profile