{# To avoid break lines #} {% for key, value in data %} {% if value is iterable %} {% for subData in value %} {% include 'AppBundle:Admin:Export\\Include\\include_table_row.html.twig' with { 'data': subData, 'subTdClass': 'sub-line' } %} {% endfor %} {% else %} {% set tdClass = subTdClass is defined ? subTdClass : '' %} {# Match integer #} {% if value matches '/^\\d+$/' %} {% set tdClass = tdClass ~ ' column-integer' %} {% endif %} {# Match floating point number #} {% if value matches '/^[-+]?[0-9]*[.,]?[0-9]+$/' %} {% set tdClass = tdClass ~ ' column-numeric' %} {% endif %} {% include [ 'AppBundle:Admin:Export\\Include\\include_' ~ (key|camelCaseToUnderscore|lower|replace({'.':'_'})) ~ '.html.twig', 'AppBundle:Admin:Export\\base_pdf_value.html.twig' ] with { 'key': key, 'value': value } %} {% endif %} {% endfor %}