protected function renderCrumbs()
{
end($this->breadcrumbs);
$lastKey = key($this->breadcrumbs);
$output = '';
$hrefSegments = array();
$position = 1;
foreach ($this->breadcrumbs as $key => $crumb) {
$isLast = $lastKey === $key;
if ($crumb['hrefIsFullUrl']) {
$hrefSegments = array();
}
if ($crumb['href']) {
$hrefSegments[] = $crumb['href'];
}
$href = implode('/', $hrefSegments);
if (!preg_match('#^https?://.*#', $href)) {
$href = "/{$href}";
}
$output .= $this->renderCrumb($crumb['name'], $href, $isLast, $position);
$position++;
}
return $output;
}