Files
lean/view/lean/widget/breadcrumb.phtml
T

33 lines
1.4 KiB
PHTML

{% if isset($this->breadcrumb) %}
{% php $routeTree = $this->breadcrumb->getRouteTree($this->session->get('lean.route')) %}
{% if count($routeTree) %}
<ol class="breadcrumb mb-4 px-3 py-2">
{% foreach $routeTree as $index => $crumb %}
<li class="breadcrumb-item {% if $crumb->current %}active{% endif %}">
{% if ! $crumb->current %}
{% php $last = $crumb %}
<a href="{% route $crumb->routeAnnotation->name %}">
{% if $crumb->icon ?? false %}
<i class="fa fa-{{ $crumb->icon }}"></i>
{% endif %}
<span>{{ lang($crumb->lang, get_defined_vars()) }}</span>
</a>
{% else %}
{% if $crumb->icon ?? false %}
<i class="fa fa-{{ $crumb->icon }}"></i>
{% endif %}
<span>{{ lang($crumb->lang, get_defined_vars()) }}</span>
{% endif %}
</li>
{% endforeach %}
{# if $last ?? false %}
<li class="breadcrumb-last-item ml-auto"><a href="{{ ( $last['route'] ?? false ) ? $last['route'] : url($last['url']) }}"><i class="fas fa-chevron-circle-left"></i> Retour</a></li>
{% endif #}
</ol>
{% endif %}
{% endif %}