{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {% if collector.displayInWdt %} {% set icon %} Twig Twig {% endset %} {% set text %}
Template{{ 1 == collector.templates|length ? ':' : 's'}} {% if 1 == collector.templates|length %} {% set template = collector.templates|first %} {% if template.path %} {{ template.name }} {% else %} {{ template.name }} {% endif %} {% else %} {{ collector.templates|length }} {% endif %}
Globals {{ collector.globals|length }}
Extensions {{ collector.extensions|length }}
avail. Tests {{ collector.tests|length }}
avail. Filters {{ collector.filters|length }}
avail. Functions {{ collector.functions|length }}
{% endset %} {% include '@WebProfiler/Profiler/toolbar_item.html.twig' with { 'link': profiler_url } %} {% endif %} {% endblock %} {% block menu %} Twig {{ collector.extensions|length }} {% endblock %} {% block panel %} {% set profiler_markup_version = profiler_markup_version|default(1) %} {% if profiler_markup_version == 2 %}

Twig metrics

{{ collector.globals|length }} Globals
{{ collector.extensions|length }} Extensions
{{ collector.tests|length }} Tests
{{ collector.filters|length }} Filters
{{ collector.functions|length }} Functions
{% endif %} {% if collector.templates|length %}

Twig Templates

{% for template in collector.templates %} {% endfor %}
Template Parameters
{% if template.path %} {{ template.name }} {% else %} {{ template.name }} {% endif %} {% for parameter, metadata in template.parameters %} {% if metadata.type == 'boolean' %} {% set value = metadata.value ? 'true' : 'false' %} {% elseif metadata.type == 'string' %} {% set maxStrLength = 40 %} {% set value = metadata.value %} {% if value|length > maxStrLength %} {% set value = value|slice(0, maxStrLength) ~ '…' %} {% endif %} {% set value = '"' ~ value ~ '"' %} {% else %} {% set value = metadata.value %} {% endif %} {{ parameter }}: {{ metadata.type }} {{ value }} {% if not loop.last %}
{% endif %} {% endfor %}
{% endif %} {% if collector.globals|length %}

Twig Globals

{% for global in collector.globals %} {% endfor %}
Name Value
{{ global.name }} {{ global.value }}
{% endif %} {% if collector.extensions|length %}

Twig Extensions

{% for extension in collector.extensions %} {% endfor %}
Extension Class
{{ extension.name }} {{ extension.class }}
{% endif %} {% if collector.tests|length %}

Twig Tests available

{% for test in collector.tests %} {% endfor %}
Test Call Extension
{{ test.name }} {{ test.call }} {{ test.extension }}
{% endif %} {% if collector.filters|length %}

Twig Filters available

{% for filter in collector.filters %} {% endfor %}
Filter Call Extension
{{ filter.name }} {{ filter.call }} {{ filter.extension }}
{% endif %} {% if collector.functions|length %}

Twig Functions available

{% for function in collector.functions %} {% endfor %}
Function Call Extension
{{ function.name }} {{ function.call }} {{ function.extension }}
{% endif %} {% endblock %}