PHP code example of lcharette / uf_breadcrumb

1. Go to this page and download the library: Download lcharette/uf_breadcrumb library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lcharette / uf_breadcrumb example snippets


// add($name, $uri = "")
$this->ci->breadcrumb->add('Item name', 'path/');

$this->ci->breadcrumb->add("Projects", "projects/")
                     ->add("Project Foo", "projects/foo")
                     ->add("Settings");

$crumb = new Crumb();
$crumb->setTitle('Item name')->setUri('path/');
$this->ci->breadcrumb->addCrumb($crumb);

$this->ci->breadcrumb->add(['TRANSLATION_KEY', ['placeholder' => 'Value']], 'path/');

// or

$crumb = new Crumb();
$crumb->setTitle('TRANSLATION_KEY', ['placeholder' => 'Value'])->setUri('path/');

$this->ci->breadcrumb->add('Item name', ['route_name', ['id' => '123']]);

// or

$crumb = new Crumb();
$crumb->setTitle('Item name')->setRoute('route_name', ['id' => '123']);

//prepend($name, $uri = "")
$this->ci->breadcrumb->prepend("Item name", "path/");

// or

$this->ci->breadcrumb->prependCrumb($crumb);