ui2022/schoolnow/side__menu__item.html.twig line 1

Open in your IDE?
  1. {% set link = _args.link %}
  2. {% set title = _args.title %}
  3. {% set icon = _args.icon|default(null) %}
  4. {% set active = _args.active|default(false) %}
  5. {% set items = _args.items|default([])|filter((item) => item is not empty and (not item.permission is defined or is_granted(item.permission))) %}
  6. {% set target = _args.target|default(null) %}
  7. {% if items %}
  8.     {% for item in items %}
  9.         {% if item.active|default(false) %}
  10.             {% set active = true %}
  11.         {% endif %}
  12.     {% endfor %}
  13. {% endif %}
  14. <li class="{% if items %}aside__dropdown{% if active %} aside__dropdown--active{% endif %}{% endif %}">
  15.     <a
  16.         class="{% if active %}active{% endif %}"
  17.         href="{{ link|e('html_attr') }}"
  18.         {% if target %}target="{{ target|e('html_attr') }}"{% endif %}
  19.     >
  20.         {% if icon %}
  21.             <span class="aside__icon">
  22.                 <i class="{{ icon }}"></i>
  23.             </span>
  24.         {% endif %}
  25.         <span>{{ title }}</span>
  26.     </a>
  27.     {% if items %}
  28.         <span class="aside__dropdown--toggle">
  29.             <i class="icon-chevron-down"></i>
  30.         </span>
  31.         <ul class="aside__dropdown--list">
  32.             {% for item in items %}
  33.                 {% include '@ui2022/schoolnow/side__menu__item.html.twig' with item %}
  34.             {% endfor %}
  35.         </ul>
  36.     {% endif %}
  37. </li>