Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

twig first last element

{% 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 #element
ADD COMMENT
Topic
Name
2+2 =