Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

twig last item

{% for elem in arrMenu %}
    {% if loop.first %}
    <div class="topmenu-button first">        
    {% elseif loop.last %}
    <div class="topmenu-button last">        
    {% else %}
    <div class="topmenu-button">        
    {% endif %}
        <a href="{{ elem.url }}">{{ elem.name }}</a>
    </div>
{% endfor %}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #twig #item
ADD COMMENT
Topic
Name
2+5 =