2026-02-11 19:28:12 +01:00
|
|
|
<?php
|
2026-04-05 17:17:06 +02:00
|
|
|
$items = array_values(array_filter($breadcrumbs ?? [], static function ($item) {
|
2026-02-11 19:28:12 +01:00
|
|
|
return !empty($item['label']);
|
|
|
|
|
}));
|
|
|
|
|
if (!$items) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
$lastIndex = count($items) - 1;
|
|
|
|
|
?>
|
2026-03-24 14:51:40 +01:00
|
|
|
<nav class="app-breadcrumb" aria-label="<?php e(t('Breadcrumb')); ?>">
|
|
|
|
|
<ol>
|
|
|
|
|
<?php foreach ($items as $index => $item): ?>
|
|
|
|
|
<?php
|
|
|
|
|
$label = (string) ($item['label'] ?? '');
|
|
|
|
|
$href = (string) ($item['href'] ?? '');
|
|
|
|
|
$path = (string) ($item['path'] ?? '');
|
|
|
|
|
$isLast = $index === $lastIndex;
|
|
|
|
|
if ($href === '' && $path !== '') {
|
|
|
|
|
$href = lurl($path);
|
|
|
|
|
}
|
|
|
|
|
?>
|
|
|
|
|
<li>
|
|
|
|
|
<?php if ($href !== '' && !$isLast): ?>
|
|
|
|
|
<a href="<?php e($href); ?>"><?php e($label); ?></a>
|
|
|
|
|
<?php else: ?>
|
|
|
|
|
<span<?php if ($isLast): ?> aria-current="page"<?php endif; ?>><?php e($label); ?></span>
|
|
|
|
|
<?php endif; ?>
|
|
|
|
|
</li>
|
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
</ol>
|
|
|
|
|
</nav>
|