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

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

geeklabs/ci4-breadcrumbs
========================

Breadcrumb navigation for CodeIgniter 4

v2.0.9(3y ago)2813.5k↑75%13[2 PRs](https://github.com/GeekLabsUK/CI4-Breadcrumbs/pulls)MITPHPPHP ^8.0

Since Dec 5Pushed 2y ago3 watchersCompare

[ Source](https://github.com/GeekLabsUK/CI4-Breadcrumbs)[ Packagist](https://packagist.org/packages/geeklabs/ci4-breadcrumbs)[ RSS](/packages/geeklabs-ci4-breadcrumbs/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)DependenciesVersions (12)Used By (0)

[![code score](https://camo.githubusercontent.com/a5a1adf8421bdabbdf820d86425f8868a6a151e2e5e79d0d26887ed7ab61f5f9/68747470733a2f2f6170692e636f646967612e696f2f70726f6a6563742f31363338362f73636f72652f737667)](https://camo.githubusercontent.com/a5a1adf8421bdabbdf820d86425f8868a6a151e2e5e79d0d26887ed7ab61f5f9/68747470733a2f2f6170692e636f646967612e696f2f70726f6a6563742f31363338362f73636f72652f737667) [![code grade](https://camo.githubusercontent.com/0fcc1a0be1ea40f34299d5a30d0d3448122b81a58419ff17e61723b72841c875/68747470733a2f2f6170692e636f646967612e696f2f70726f6a6563742f31363338362f7374617475732f737667)](https://camo.githubusercontent.com/0fcc1a0be1ea40f34299d5a30d0d3448122b81a58419ff17e61723b72841c875/68747470733a2f2f6170692e636f646967612e696f2f70726f6a6563742f31363338362f7374617475732f737667)

CI4-Breadcrumbs
===============

[](#ci4-breadcrumbs)

Simple breadcrumb library for Codeigniter 4

V3.0 Coming Soon
----------------

[](#v30-coming-soon)

With support for generating breadcrumbs for the major css frame works.

V2.0.9 Released
---------------

[](#v209-released)

Version 2.0.9 has had a few major changes. Mainly on how you install the library. The entire library has been re-packaged and now has support to publish the core file to your application.

The publishing command will create a new directly called 'modules' within your app folder. Why 'modules' ? Because we plan on releasing several easy to install modules that can be installed and keeps your application structure neat and organised.

You now have the options of either manually building your breadcrumbs or using the auto builder. The auto builder takes your URI string and breaks it down into a bootstrap breadcrumb.

We have also added the option to build your breadcrumbs using the awesome HalfMoon CSS framework. More CSS frameworks will be added in V3.0

### Install Via Composer

[](#install-via-composer)

```
composer require geeklabs/ci4-breadcrumbs

```

Then run

```
php spark breadcrumbs:publish

```

You will then be asked what css frame work you are using. Please make your selection and hit enter

At the moment you have the option of Bootstrap or the awesome HalfMoon framework. More frameworks will be added in V3.0

```
What css framework are you using?:
  [0]  Bootstrap
  [1]  Halfmoon

```

Load into controller

```
use  App\Modules\Breadcrumbs\Breadcrumbs;

```

If you dont want to publish to your project and would prefer to keep the library in your 'vendors' folder you can omit the 'php spark breadcrumbs:publish' command and use the namespace :

```
use  Geeklabs\Breadcrumbs\Core\Breadcrumbs;

```

If you dont publish to your project and are calling the library from the vendors folder you will need to modify the config file located at 'vendor/geeklabs/ci4-breadcrumbs/src/config/config.php' manually to select the correct css framework.

### Usage

[](#usage)

Out of the box breadcrumbs are set up using Bootstrap styles ie.

```

    Home
    Library

```

If you want to override these styles, add additional classes etc you can do that in the \_\_construct function of Breadcrumbs.php

More CSS framework support is being added in v3.0. If you have a specific framework you want added please submit an issue and we will add it.

To use the library first load it into your controller

```
use App\libraries\Breadcrumb;

```

Create an instance

```
$this->breadcrumb = new Breadcrumb();

```

Auto Build
----------

[](#auto-build)

If you want simple breadcrumbs to auto build the breadcrumbs for you based on your URL you can do so by calling

```
$data['breadcrumbs'] = $this->breadcrumb->buildAuto();

```

Then simply echo it out in your view

```

```

### Done! That simple.

[](#done-that-simple)

Well almost. Now your breadcrumbs are being generated automatically based on your URI you need to make some extra conciderations when you are building out your routes. For example if you have a route like

```
 $routes->add('admin/customers/profile', 'Controller::index')

```

your breadcrumb will be

```
Admin / Customer / Profile

```

So admin and customer must also have a route set for them.

If you want your breadcrumbs to remain readable you can add a - in your URI segement to force a space ie

```
edit-customer = Edit Customer

```

Manual Build
------------

[](#manual-build)

If you want a little bit more control over your breadcrumbs you can still build them manually.

Build your breadcrumbs

```
 $this->breadcrumb->add('Home', '/');
 $this->breadcrumb->add('Dashboard', '/dashboard');
 $this->breadcrumb->add('Customers', '/customers');
```

ensure to include the / before your url

Build the breadcrumbs using

```
$data['breadcrumbs'] = $this->breadcrumb->render();

```

Pass the data to your view and then

```

```

Example controller :

```
namespace App\Controllers;

use CodeIgniter\Controller;
use App\Modules\Breadcrumbs\Breadcrumbs;

class Home extends Controller{

   public $breadcrumb;

   public function __construct()
   {
       $this->breadcrumb = new Breadcrumb();
   }

   public function index(){

       $this->breadcrumb->add('Home', '/');
       $this->breadcrumb->add('Dashboard', '/dashboard');
       $this->breadcrumb->add('Customer', '/dashboard/customer');

       $data['breadcrumbs'] = $this->breadcrumb->render();

       return view('home', $data);

   }

}
```

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

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

Total

10

Last Release

1247d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5fd7034d93ae89845089190135d98cdeea4961cdc9eac651b7ab835b90d820e3?d=identicon)[GeekLabs](/maintainers/GeekLabs)

---

Top Contributors

[![GeekLabsUK](https://avatars.githubusercontent.com/u/68666817?v=4)](https://github.com/GeekLabsUK "GeekLabsUK (33 commits)")

---

Tags

menunavigationbreadcrumbsCodeIgniter 4

### Embed Badge

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

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

###  Alternatives

[spatie/menu

Html menu generator

7592.9M6](/packages/spatie-menu)[verbb/navigation

Create navigation menus for your site.

90683.7k17](/packages/verbb-navigation)[kartik-v/yii2-widget-sidenav

An enhanced side navigation menu styled for bootstrap (sub repo split from yii2-widgets)

364.0M8](/packages/kartik-v-yii2-widget-sidenav)[caffeinated/menus

Laravel Menus

134159.5k5](/packages/caffeinated-menus)[extpoint/yii2-megamenu

Configurable site map with auto generate page title, breadcrumbs and navigation

3310.9k](/packages/extpoint-yii2-megamenu)[akaunting/laravel-menu

Menu and sidebar management package for Laravel

38233.8k](/packages/akaunting-laravel-menu)

PHPackages © 2026

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