bytic /
navigation
| 1 | <?php |
||
| 2 | |||
| 3 | /** @var \ByTIC\Navigation\Breadcrumbs\Breadcrumbs $breadcrumbs */ |
||
| 4 | $firstBreadcrumb = reset($breadcrumbs); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 5 | $lastBreadcrumb = end($breadcrumbs); |
||
| 6 | ?> |
||
| 7 | <?php if (count($breadcrumbs)) { ?> |
||
| 8 | <div id="breadcrumbs"> |
||
| 9 | <ol class="breadcrumb"> |
||
| 10 | <?php foreach ($breadcrumbs as $crumb) { ?> |
||
| 11 | <?php |
||
| 12 | $classes = []; |
||
| 13 | if ($crumb == $firstBreadcrumb) { |
||
| 14 | $classes[] = 'first'; |
||
| 15 | } |
||
| 16 | if ($crumb == $lastBreadcrumb) { |
||
| 17 | $classes[] = 'active'; |
||
| 18 | } |
||
| 19 | ?> |
||
| 20 | |||
| 21 | <li class="<?php echo $classes ? implode(" ", $classes).'' : ''; ?>" > |
||
| 22 | <a href="<?php echo $crumb->url(); ?>" title="<?php echo $crumb->title(); ?>"> |
||
| 23 | <?php echo $crumb->title(); ?> |
||
| 24 | </a> |
||
| 25 | </li> |
||
| 26 | <?php } ?> |
||
| 27 | </ol> |
||
| 28 | </div> |
||
| 29 | <?php } ?> |