Answer the question
In order to leave comments, you need to log in
Breadcrumbs on twig?
Greetings !
There is such breadcrumbs in php
<ul class="breadcrumb">
<?php foreach ($breadcrumbs as $i=> $breadcrumb) { ?>
<?php if($i+1<count($breadcrumbs)) { ?>
<li><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
» </li>
<?php } else { ?>
<li><?php echo $breadcrumb['text']; ?></li>
<?php } ?>
<?php } ?>
</ul>
{% for breadcrumb in breadcrumbs %}
<a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a> »
{% endfor %}
Answer the question
In order to leave comments, you need to log in
Decision
{% for breadcrumb in breadcrumbs %}
{% if loop.last %}
<span>{{ breadcrumb.text }}</span>
{% else %}
<a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a> »
{% endif %}
{% endfor %}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question