PHP code example of dluwang / breadcrumb

1. Go to this page and download the library: Download dluwang/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/ */

    

dluwang / breadcrumb example snippets


public function __construct($id, $label, $url, Crumb $prev = null)

$crumb->toArray();

results: [['crumb-1', 'crumb 1', '/crumb-1'], ['crumb-2', 'crumb 2', '/crumb-2']]

$breadcrumb = new InMemoryBreadcrumb()

$breadcrumb->register($crumb) // single crumb registration
$navigator->register([$crumb1, $crumb2]) // mutiple crumbs

$breadcrumb->crumb('crumb-id')

$global = new Crumb('the-id', 'the-label', 'the-url');
$breadcrumb->prev($global);