events.html.twig 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. {% extends '@WebProfiler/Profiler/layout.html.twig' %}
  2. {% import _self as helper %}
  3. {% block menu %}
  4. <span class="label">
  5. <span class="icon">{{ include('@WebProfiler/Icon/event.svg') }}</span>
  6. <strong>Events</strong>
  7. </span>
  8. {% endblock %}
  9. {% block panel %}
  10. <h2>Event Dispatcher</h2>
  11. {% if collector.calledlisteners is empty %}
  12. <div class="empty">
  13. <p>No events have been recorded. Check that debugging is enabled in the kernel.</p>
  14. </div>
  15. {% else %}
  16. <div class="sf-tabs">
  17. <div class="tab">
  18. <h3 class="tab-title">Called Listeners <span class="badge">{{ collector.calledlisteners|length }}</span></h3>
  19. <div class="tab-content">
  20. {{ helper.render_table(collector.calledlisteners) }}
  21. </div>
  22. </div>
  23. <div class="tab">
  24. <h3 class="tab-title">Not Called Listeners <span class="badge">{{ collector.notcalledlisteners|length }}</span></h3>
  25. <div class="tab-content">
  26. {% if collector.notcalledlisteners is empty %}
  27. <div class="empty">
  28. <p>
  29. <strong>There are no uncalled listeners</strong>.
  30. </p>
  31. <p>
  32. All listeners were called for this request or an error occurred
  33. when trying to collect uncalled listeners (in which case check the
  34. logs to get more information).
  35. </p>
  36. </div>
  37. {% else %}
  38. {{ helper.render_table(collector.notcalledlisteners) }}
  39. {% endif %}
  40. </div>
  41. </div>
  42. <div class="tab">
  43. <h3 class="tab-title">Orphaned Events <span class="badge">{{ collector.orphanedEvents|length }}</span></h3>
  44. <div class="tab-content">
  45. {% if collector.orphanedEvents is empty %}
  46. <div class="empty">
  47. <p>
  48. <strong>There are no orphaned events</strong>.
  49. </p>
  50. <p>
  51. All dispatched events were handled or an error occurred
  52. when trying to collect orphaned events (in which case check the
  53. logs to get more information).
  54. </p>
  55. </div>
  56. {% else %}
  57. <table>
  58. <thead>
  59. <tr>
  60. <th>Event</th>
  61. </tr>
  62. </thead>
  63. <tbody>
  64. {% for event in collector.orphanedEvents %}
  65. <tr>
  66. <td class="font-normal">{{ event }}</td>
  67. </tr>
  68. {% endfor %}
  69. </tbody>
  70. </table>
  71. {% endif %}
  72. </div>
  73. </div>
  74. </div>
  75. {% endif %}
  76. {% endblock %}
  77. {% macro render_table(listeners) %}
  78. <table>
  79. <thead>
  80. <tr>
  81. <th class="text-right">Priority</th>
  82. <th>Listener</th>
  83. </tr>
  84. </thead>
  85. {% set previous_event = (listeners|first).event %}
  86. {% for listener in listeners %}
  87. {% if loop.first or listener.event != previous_event %}
  88. {% if not loop.first %}
  89. </tbody>
  90. {% endif %}
  91. <tbody>
  92. <tr>
  93. <th colspan="2" class="colored font-normal">{{ listener.event }}</th>
  94. </tr>
  95. {% set previous_event = listener.event %}
  96. {% endif %}
  97. <tr>
  98. <td class="text-right nowrap">{{ listener.priority|default('-') }}</td>
  99. <td class="font-normal">{{ profiler_dump(listener.stub) }}</td>
  100. </tr>
  101. {% if loop.last %}
  102. </tbody>
  103. {% endif %}
  104. {% endfor %}
  105. </table>
  106. {% endmacro %}