src/Front/Templates/Menu/menu.html.twig line 1
{% extends 'knp_menu_base.html.twig' %}{% macro attributes(attributes) %}{% for name, value in attributes %}{%- if value is not none and value is not same as(false) -%}{{- ' %s="%s"'|format(name, value is same as(true) ? name|e : value|e)|raw -}}{%- endif -%}{%- endfor -%}{% endmacro %}{% block compressed_root %}{% apply spaceless %}{{ block('root') }}{% endapply %}{% endblock %}{% block root %}{% set listAttributes = item.childrenAttributes %}{{ block('list') -}}{% endblock %}{% block list %}{% if item.level == 0 %}<ul class="navbar-nav mx-auto mb-2 mb-md-0 gap-md-3">{{ block('children') }}</ul>{% else %}{{ block('children') }}{% endif %}{% endblock %}{% block children %}{# save current variables #}{% set currentOptions = options %}{% set currentItem = item %}{# update the depth for children #}{% if options.depth is not none %}{% set options = options|merge({'depth': currentOptions.depth - 1}) %}{% endif %}{# update the matchingDepth for children #}{% if options.matchingDepth is not none and options.matchingDepth > 0 %}{% set options = options|merge({'matchingDepth': currentOptions.matchingDepth - 1}) %}{% endif %}{% for item in currentItem.children %}{{ block('item') }}{% endfor %}{# restore current variables #}{% set item = currentItem %}{% set options = currentOptions %}{% endblock %}{% block item %}{% if item.displayed %}<li class="nav-item">{{ block('linkElement') }}{#{% if item.hasCHildren %}<div id="menu_items_{{ loop.index }}" class="collapse show">{{ block('list') }}</div>{% endif %}#}</li>{% endif %}{% endblock %}{% block linkElement %}{% import _self as knp_menu %}{% set attributes = item.linkAttributes %}{% set classes = attributes['class'] is defined ? [attributes['class']] : [] %}{% set classes = classes|merge(['nav-link']) %}{% if matcher.isCurrent(item) %}{% set classes = classes|merge(['active active text-primary']) %}{% endif %}{% set attributes = attributes|merge({'class': classes|join(' ')}) %}<a href="{{ item.uri }}"{{ knp_menu.attributes(attributes) }}>{{ block('label') }}</a>{% endblock %}{% block label %}{% if item.getExtra('icon') != '' %}<i class="me-3 {{ item.getExtra('icon') }}"></i>{% endif %}{% if options.allow_safe_labels and item.getExtra('safe_label', false) %}{{ item.label|raw }}{% else %}{{ item.label }}{% endif %}{% endblock %}