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

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xety/breadcrumbs
================

A simple breadcrumbs generator with fluent pattern.

1.2.0(1y ago)03.9k↑421.7%MITPHPPHP &gt;=7.0

Since Jun 4Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Xety/Breadcrumbs)[ Packagist](https://packagist.org/packages/xety/breadcrumbs)[ Docs](https://github.com/Xety/Breadcrumbs)[ RSS](/packages/xety-breadcrumbs/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (6)Versions (4)Used By (0)

Breadcrumbs
===========

[](#breadcrumbs)

TravisCoverageStable VersionDownloadsPHPLicense[![Build Status](https://camo.githubusercontent.com/8f0352ded343d79fbaa411e93715c774c45931cf79da73fafba91a2d2572b01f/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f586574792f42726561646372756d62732e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Xety/Breadcrumbs)[![Coverage Status](https://camo.githubusercontent.com/06e16d68ea11750aa36efd92e9e41afc36afd327ed15880d002f48ee55307bf7/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f586574792f42726561646372756d62732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/Xety/Breadcrumbs)[![Latest Stable Version](https://camo.githubusercontent.com/cb6dcd79ea0410bfb6c95295473e4c1518a57c869cb7ec99ec3f07df5a5d30c8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f586574792f42726561646372756d62732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xety/breadcrumbs)[![Total Downloads](https://camo.githubusercontent.com/1ab01df484816aeda490a404c74aec843411b52233ed97a0594406a4fe3d913e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f786574792f62726561646372756d62732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/xety/breadcrumbs)[![Laravel 5.4](https://camo.githubusercontent.com/5ea352a7ed2d32cec78897ec0650129f7f58b815bfaae30ab9cc9dcec069f7f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d372e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/Xety/Breadcrumbs)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/Xety/Breadcrumbs/blob/master/LICENSE)A breadcrumbs generator that use the Fluent pattern. This library is inspired by [creitive/breadcrumbs](https://github.com/creitive/breadcrumbs) but was fully rewritten to be fully customizable.

Requirement
===========

[](#requirement)

[![PHP](https://camo.githubusercontent.com/5ea352a7ed2d32cec78897ec0650129f7f58b815bfaae30ab9cc9dcec069f7f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d372e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/5ea352a7ed2d32cec78897ec0650129f7f58b815bfaae30ab9cc9dcec069f7f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d2533453d372e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)

Installation
============

[](#installation)

```
composer require xety/breadcrumbs
```

Usage
=====

[](#usage)

### Instance

[](#instance)

To use the Breadcrumbs class, you just need to instance it :

```
use Xety\Breadcrumbs\Breadcrumbs;

$breadcrumbs = new Breadcrumbs;

// Or with breadcrumbs and options:
$breadcrumbs = new Breadcrumbs(
    [
        [
            'name' => 'Home',
            'href' => '/home'
        ],
        [
            'name' => 'Blog',
            'href' => '/blog'
        ]
    ],
    [
        'position' => true
    ]
);
```

### Output

[](#output)

To render your breadcrumbs, you can invoke the function `render()` or directly "echoing" it:

```
echo $breadcrumbs->render();

// Or, since this class implement the magic method `__toString()`,
// you can directly echo the instance :
echo $breadcrumbs;
```

#### Output examples:

[](#output-examples)

This class is configured **by default** to render with the Bootstrap 4 style. So with the above configuration, the output will look like that :

```

    Home
    Blog

```

Full featured example :

```
$breadcrumbs = new Breadcrumbs(
    [
        [
            'name' => 'Home',
            'href' => '/home'
        ],
        [
            'name' => 'Blog',
            'href' => 'blog' // Note there is no `slash` here.
        ],
        [
            'name' => 'Test',
            'href' => 'http://xeta.io/blog/test'
        ],
        [
            'name' => 'Article',
            'href' => '/article'
        ]
    ],
    [
        'position' => true,
        'divider' => '#',
        'dividerElement' => 'li',
        'dividerElementClasses'=> [
            'custom',
            'divider'
        ],
        'listElement' => 'ul',
        'listElementClasses' => [
            'custom',
            'container'
        ],
        'listItemElement' => 'li',
        'listItemElementClasses' => [
            'custom',
            'item'
        ],
        'listActiveElement' => 'li',
        'listActiveElementClasses' => [
            'custom',
            'active'
        ]
    ]
);
```

Output :

```

    Home
    #
    Blog
    #
    Test
    #
    Article

```

Options
=======

[](#options)

This is the list of all available options and also all default options :

```
[
    // Whether to enable or not the `data-position` attribute.
    'position' => false,
    // The divider symbol between the crumbs or `null` to disable it.
    'divider' => null,
    // The DOM-Element used to generate the divider element.
    'dividerElement' => 'span',
    // Classes applied to the item `dividerElement` element.
    'dividerElementClasses'=> [
        'divider'
    ],
    // The DOM-Element used to generate the container element.
    'listElement' => 'nav',
    // Classes applied to the main `listElement` container element.
    'listElementClasses' => [
        'breadcrumb'
    ],
    // The DOM-Element used to generate the list item.
    'listItemElement' => 'a',
    // Classes applied to the list item `listItemElement` element.
    'listItemElementClasses' => [
        'breadcrumb-item'
    ],
    // The DOM-Element used to generate the active list item.
    'listActiveElement' => 'span',
    // Classes applied to the active item `listActiveElement` element.
    'listActiveElementClasses' => [
        'breadcrumb-item',
        'active'
    ]
]
```

Documentation
=============

[](#documentation)

You can find all methods available with their documentation [here](https://github.com/Xety/Breadcrumbs/blob/master/docs/Breadcrumbs.md).

Contribute
==========

[](#contribute)

If you want to contribute, please [follow this guide](https://github.com/Xety/Breadcrumbs/blob/master/.github/CONTRIBUTING.md).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance46

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

3

Last Release

420d ago

### Community

Maintainers

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

---

Top Contributors

[![Xety](https://avatars.githubusercontent.com/u/8210023?v=4)](https://github.com/Xety "Xety (3 commits)")

---

Tags

breadcrumbscustomizablefluentpatternfluentpatternbreadcrumbs

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[league/pipeline

A plug and play pipeline implementation.

1.0k16.0M74](/packages/league-pipeline)[samrap/acf-fluent

A fluent interface for the Advanced Custom Fields WordPress plugin

28656.0k4](/packages/samrap-acf-fluent)[creitive/breadcrumbs

Simple breadcrumbs class

86466.4k7](/packages/creitive-breadcrumbs)[getsolaris/laravel-make-service

A MVCS pattern create a service command for Laravel 5+

81161.3k](/packages/getsolaris-laravel-make-service)[redeyeventures/geopattern

Generate beautiful SVG patterns.

11140.8k2](/packages/redeyeventures-geopattern)[functional-php/pattern-matching

Pattern matching for PHP with automatic destructuring.

8261.5k](/packages/functional-php-pattern-matching)

PHPackages © 2026

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