<?php
require_once "breadcrumbs_3.3.2/autoload.php";
$breadcrumbs = new Creitive\Breadcrumbs\Breadcrumbs;

$array_urls = $_SESSION['pathDirectory'];

$server = $_SERVER['HTTP_REFERER'];
$serverURI = explode('?',$server);
$server = $serverURI[0];

$URI = str_replace('edas_navigator_dashboard.php','',$server); // parte de la URL que hay que añadir a las referencias

for ($x = 0; $x < count($array_urls); $x++) {
    if ($x == 0) {
        $breadcrumbs->addCrumb('<span class="glyphicon glyphicon-home"></span>', $URI.$array_urls[$x]['url']);
    } else {
        $breadcrumbs->addCrumb($array_urls[$x]['code'], $URI.$array_urls[$x]['url']);
    }
}

// $breadcrumbs->addCrumb('<img src="/images/foo.png">', '/foo');
// $breadcrumbs->addCrumb(htmlspecialchars($userSubmittedName), 'bar');

$breadcrumbs->setDivider('');
$breadcrumbs->setListElement('ol');
$breadcrumbs->setCssClasses("breadcrumb");
$breadcrumbs->setLastItemWithHref(false);

echo $breadcrumbs->render();