PHP code example of jinnguyen / puja-breadcrumb

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

    

jinnguyen / puja-breadcrumb example snippets



use Puja\Breadcrumb\Breadcrumb;

$breadcrumb->add('Home', '/');

$breadcrumb->deleteAll();

$breadcrumb->deleteLastItem();

$breadcrumb->count();

$breadcrumb->isEmpty(); // same with $breadcrumb->count() == 0

$breadcrumb->getData(); // get all breadcrumb nodes

$breadcrumb->setFirstCssClassName($className);
$breadcrumb->setLastCssClassName($className);

$breadcrumb->setElement('<span class="{FirstLastCss}">%s{Divider}</span>');

$breadcrumbs->setListElement('<ol class="ol-breadcrumb">%s</ol>');

$breadcrumb->setDivider('/');

echo $breadcrumb->render();

$breadcrumb->setSafeHtml(false);