Skip to content

Instantly share code, notes, and snippets.

View alef-carvalho's full-sized avatar
🏠
Working from home

Alef Carvalho alef-carvalho

🏠
Working from home
  • Brazil
View GitHub Profile
@alef-carvalho
alef-carvalho / recursive_list.twig
Created July 2, 2019 16:12 — forked from isthatcentered/recursive_list.twig
Recursive list template for Twig using recursive macros. Compatible Twig 2.x // for grandpas or hipsters using twig in js (hello friends :D )
{% macro list(items, class) %}
<ul class="{{class}}">
{# Iterating over each direct items #}
{% for item in items %}
<li>
<a href="">{{item.name}}</a>
{# If an item has children #}
{% if item.children %}