{% extends '@WebProfiler/Profiler/layout.html.twig' %}
{% block toolbar %}
{% if collector.displayInWdt %}
{% set icon %}
Twig
{% endset %}
{% set text %}
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
Template |
Parameters |
{% for template in collector.templates %}
{% 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 %}
|
{% endfor %}
{% endif %}
{% if collector.globals|length %}
Twig Globals
Name |
Value |
{% for global in collector.globals %}
{{ global.name }} |
{{ global.value }} |
{% endfor %}
{% endif %}
{% if collector.extensions|length %}
Twig Extensions
Extension |
Class |
{% for extension in collector.extensions %}
{{ extension.name }} |
{{ extension.class }} |
{% endfor %}
{% endif %}
{% if collector.tests|length %}
Twig Tests available
Test |
Call |
Extension |
{% for test in collector.tests %}
{{ test.name }} |
{{ test.call }} |
{{ test.extension }} |
{% endfor %}
{% endif %}
{% if collector.filters|length %}
Twig Filters available
Filter |
Call |
Extension |
{% for filter in collector.filters %}
{{ filter.name }} |
{{ filter.call }} |
{{ filter.extension }} |
{% endfor %}
{% endif %}
{% if collector.functions|length %}
Twig Functions available
Function |
Call |
Extension |
{% for function in collector.functions %}
{{ function.name }} |
{{ function.call }} |
{{ function.extension }} |
{% endfor %}
{% endif %}
{% endblock %}