explain.html.twig 885 B

12345678910111213141516171819202122232425262728
  1. {% if data[0]|length > 1 %}
  2. {# The platform returns a table for the explanation (e.g. MySQL), display all columns #}
  3. <table style="margin: 5px 0;">
  4. <thead>
  5. <tr>
  6. {% for label in data[0]|keys %}
  7. <th>{{ label }}</th>
  8. {% endfor %}
  9. </tr>
  10. </thead>
  11. <tbody>
  12. {% for row in data %}
  13. <tr>
  14. {% for key, item in row %}
  15. <td>{{ item|replace({',': ', '}) }}</td>
  16. {% endfor %}
  17. </tr>
  18. {% endfor %}
  19. </tbody>
  20. </table>
  21. {% else %}
  22. {# The Platform returns a single column for a textual explanation (e.g. PostgreSQL), display all lines #}
  23. <pre style="margin: 5px 0;">
  24. {%- for row in data -%}
  25. {{ row|first }}{{ "\n" }}
  26. {%- endfor -%}
  27. </pre>
  28. {% endif %}