{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% from _self import form_tree_entry, form_tree_details %} {% block toolbar %} {% if collector.data.nb_errors > 0 or collector.data.forms|length %} {% set status_color = collector.data.nb_errors ? 'red' : '' %} {% set icon %} {{ include('@WebProfiler/Icon/form.svg') }} {{ collector.data.nb_errors ?: collector.data.forms|length }} {% endset %} {% set text %}
Number of forms {{ collector.data.forms|length }}
Number of errors {{ collector.data.nb_errors }}
{% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} {% block menu %} {{ include('@WebProfiler/Icon/form.svg') }} Forms {% if collector.data.nb_errors > 0 %} {{ collector.data.nb_errors }} {% endif %} {% endblock %} {% block head %} {{ parent() }} {% endblock %} {% block panel %}

Forms

{% if collector.data.forms|length %}
{% for formName, formData in collector.data.forms %} {{ form_tree_details(formName, formData, collector.data.forms_by_hash, loop.first) }} {% endfor %}
{% else %}

No forms were submitted for this request.

{% endif %} {% endblock %} {% macro form_tree_entry(name, data, is_root) %} {% import _self as tree %} {% set has_error = data.errors is defined and data.errors|length > 0 %}
  • {% if has_error %}
    {{ data.errors|length }}
    {% endif %} {% if data.children is not empty %} {% else %}
    {% endif %} {{ name|default('(no name)') }}
    {% if data.children is not empty %} {% endif %}
  • {% endmacro %} {% macro form_tree_details(name, data, forms_by_hash, show) %} {% import _self as tree %}

    {{ name|default('(no name)') }} {% if data.type_class is defined %}({{ profiler_dump(data.type_class) }}){% endif %}

    {% if data.errors is defined and data.errors|length > 0 %}

    Errors

    {% for error in data.errors %} {% endfor %}
    Message Origin Cause
    {{ error.message }} {% if error.origin is empty %} This form. {% elseif forms_by_hash[error.origin] is not defined %} Unknown. {% else %} {{ forms_by_hash[error.origin].name }} {% endif %} {% if error.trace %} Caused by: {% for stacked in error.trace %} {{ profiler_dump(stacked) }} {% endfor %} {% else %} Unknown. {% endif %}
    {% endif %} {% if data.default_data is defined %}

    Default Data

    Property Value
    Model Format {% if data.default_data.model is defined %} {{ profiler_dump(data.default_data.seek('model')) }} {% else %} same as normalized format {% endif %}
    Normalized Format {{ profiler_dump(data.default_data.seek('norm')) }}
    View Format {% if data.default_data.view is defined %} {{ profiler_dump(data.default_data.seek('view')) }} {% else %} same as normalized format {% endif %}
    {% endif %} {% if data.submitted_data is defined %}

    Submitted Data

    {% if data.submitted_data.norm is defined %}
    Property Value
    View Format {% if data.submitted_data.view is defined %} {{ profiler_dump(data.submitted_data.seek('view')) }} {% else %} same as normalized format {% endif %}
    Normalized Format {{ profiler_dump(data.submitted_data.seek('norm')) }}
    Model Format {% if data.submitted_data.model is defined %} {{ profiler_dump(data.submitted_data.seek('model')) }} {% else %} same as normalized format {% endif %}
    {% else %}

    This form was not submitted.

    {% endif %}
    {% endif %} {% if data.passed_options is defined %}

    Passed Options

    {% if data.passed_options|length %} {% for option, value in data.passed_options %} {% endfor %}
    Option Passed Value Resolved Value
    {{ option }} {{ profiler_dump(value) }} {# values can be stubs #} {% set option_value = value.value|default(value) %} {% set resolved_option_value = data.resolved_options[option].value|default(data.resolved_options[option]) %} {% if resolved_option_value == option_value %} same as passed value {% else %} {{ profiler_dump(data.resolved_options.seek(option)) }} {% endif %}
    {% else %}

    No options where passed when constructing this form.

    {% endif %}
    {% endif %} {% if data.resolved_options is defined %}

    Resolved Options

    {% endif %} {% if data.view_vars is defined %}

    View Variables

    {% endif %}
    {% for childName, childData in data.children %} {{ tree.form_tree_details(childName, childData, forms_by_hash) }} {% endfor %} {% endmacro %}