request.html.twig in Devel 8.3
{% block toolbar %}
{% set request_handler %}
<a href="{{ idelink(collector.controller.file, collector.controller.line)|raw }}">{{ abbr(collector.controller.class)|raw }}
::{{ collector.controller.method }}</a>
{% endset %}
{% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red' %}
{% set request_route = collector.route ? collector.route : 'NONE' %}
{% set icon %}
<a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'request'}) }}" title="{{ 'Request'|t }}">
<img width="28" height="28" alt="{{ 'Request'|t }}"
src="data:image/png;base64,{{ collector.icon }}">
<span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}"
title="{{ collector.statustext }}">{{ collector.statuscode }}</span>
</a>
{% endset %}
{% set text %}
{% spaceless %}
<div class="sf-toolbar-info-piece">
<b>{{ 'Status'|t }}</b>
<span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}">{{ collector.statuscode }}</span> {{ collector.statustext }}
</div>
<div class="sf-toolbar-info-piece">
<b>{{ 'Controller'|t }}</b>
{{ request_handler }}
</div>
<div class="sf-toolbar-info-piece">
<b>{{ 'Route name'|t }}</b>
<span>{{ request_route }}</span>
</div>
{% endspaceless %}
{% endset %}
<div class="sf-toolbar-block">
<div class="sf-toolbar-icon">{{ icon|default('') }}</div>
<div class="sf-toolbar-info">{{ text|default('') }}</div>
</div>
{% endblock %}
{% block panel %}
<script id="request" type="text/template">
<h2 class="panel__title">{{ 'Request'|t }}</h2>
<% if (!_.isEmpty(data.request_query)) { %>
<div class="panel__container">
<h3>GET parameters</h3>
<table class="table--duo">
<thead>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th>
</thead>
<tbody>
<% _.each( data.request_query, function( item, key ){ %>
<tr>
<td><%- key %></td>
<td><%- item %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
<% } %>
<% if (!_.isEmpty(data.request_request)) { %>
<div class="panel__container">
<h3>POST parameters</h3>
<table class="table--duo">
<thead>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th>
</thead>
<tbody>
<% _.each( data.request_request, function( item, key ){ %>
<tr>
<td><%- key %></td>
<td><%= Drupal.webprofiler.helpers.frm(item) %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
<% } %>
<div class="panel__container">
<h3>Request attributes</h3>
<table class="table--duo">
<thead>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th>
</thead>
<tbody>
<% _.each( data.request_attributes, function( item, key ){ %>
<tr>
<td><%- key %></td>
<% if(key == '_controller') { %>
<td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
<% } else if(key == '_form') { %>
<td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
<% } else { %>
<td><%= Drupal.webprofiler.helpers.frm(item) %></td>
<% } %>
</tr>
<% }); %>
</tbody>
</table>
</div>
<% if (!_.isEmpty(data.request_cookies)) { %>
<div class="panel__container">
<h3>Cookies</h3>
<table class="table--duo">
<thead>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th>
</thead>
<tbody>
<% _.each( data.request_cookies, function( item, key ){ %>
<tr>
<td><%- key %></td>
<td><%= Drupal.webprofiler.helpers.frm(item) %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
<% } %>
<div class="panel__container">
<h3>Request headers</h3>
<table class="table--duo">
<thead>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th>
</thead>
<tbody>
<% _.each( data.request_headers, function( item, key ){ %>
<tr>
<td><%- key %></td>
<td><%= Drupal.webprofiler.helpers.frm(item) %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
<% if (!_.isEmpty(data.content)) { %>
<div class="panel__container">
<h3>Raw content</h3>
<div class="h--word-broken"><%- data.content %></div>
</div>
<% } %>
<% if (!_.isEmpty(data.access_check)) { %>
<div class="panel__container">
<h3>Access check</h3>
<table class="table--duo">
<thead>
<th>{{ 'Path'|t }}</th>
<th>{{ 'Service'|t }}</th>
</thead>
<tbody>
<% _.each(data.access_check, function(items, key){ %>
<tr>
<td><%- key %></td>
<td>
<% _.each(items, function(item){ %>
<%- item.service_id %>
<% }); %>
</td>
</tr>
<% }); %>
</tbody>
</table>
</div>
<% } %>
<div class="panel__container">
<h3>Server Parameters</h3>
<table class="table--duo">
<thead>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th>
</thead>
<tbody>
<% _.each( data.request_server, function( item, key ){ %>
<tr>
<td><%- key %></td>
<td><%= Drupal.webprofiler.helpers.frm(item) %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
<div class="panel__container">
<h3>Response headers</h3>
<table class="table--duo">
<thead>
<th>{{ 'Name'|t }}</th>
<th>{{ 'Value'|t }}</th>
</thead>
<tbody>
<% _.each( data.response_headers, function( item, key ){ %>
<tr>
<td><%- key %></td>
<td><%= Drupal.webprofiler.helpers.frm(item) %></td>
</tr>
<% }); %>
</tbody>
</table>
</div>
</script>
{% endblock %}
File
webprofiler/templates/Collector/request.html.twig
View source
- {% block toolbar %}
- {% set request_handler %}
- <a href="{{ idelink(collector.controller.file, collector.controller.line)|raw }}">{{ abbr(collector.controller.class)|raw }}
- ::{{ collector.controller.method }}</a>
- {% endset %}
-
- {% set request_status_code_color = (400 > collector.statuscode) ? ((200 == collector.statuscode) ? 'green' : 'yellow') : 'red' %}
-
- {% set request_route = collector.route ? collector.route : 'NONE' %}
-
- {% set icon %}
- <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'request'}) }}" title="{{ 'Request'|t }}">
- <img width="28" height="28" alt="{{ 'Request'|t }}"
- src="data:image/png;base64,{{ collector.icon }}">
- <span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}"
- title="{{ collector.statustext }}">{{ collector.statuscode }}</span>
- </a>
- {% endset %}
-
- {% set text %}
- {% spaceless %}
- <div class="sf-toolbar-info-piece">
- <b>{{ 'Status'|t }}</b>
- <span class="sf-toolbar-status sf-toolbar-status-{{ request_status_code_color }}">{{ collector.statuscode }}</span> {{ collector.statustext }}
- </div>
- <div class="sf-toolbar-info-piece">
- <b>{{ 'Controller'|t }}</b>
- {{ request_handler }}
- </div>
- <div class="sf-toolbar-info-piece">
- <b>{{ 'Route name'|t }}</b>
- <span>{{ request_route }}</span>
- </div>
- {% endspaceless %}
- {% endset %}
-
- <div class="sf-toolbar-block">
- <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
- <div class="sf-toolbar-info">{{ text|default('') }}</div>
- </div>
- {% endblock %}
-
- {% block panel %}
- <script id="request" type="text/template">
- <h2 class="panel__title">{{ 'Request'|t }}</h2>
-
- <% if (!_.isEmpty(data.request_query)) { %>
- <div class="panel__container">
- <h3>GET parameters</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Name'|t }}</th>
- <th>{{ 'Value'|t }}</th>
- </thead>
- <tbody>
- <% _.each( data.request_query, function( item, key ){ %>
- <tr>
- <td><%- key %></td>
- <td><%- item %></td>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
- <% } %>
-
- <% if (!_.isEmpty(data.request_request)) { %>
- <div class="panel__container">
- <h3>POST parameters</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Name'|t }}</th>
- <th>{{ 'Value'|t }}</th>
- </thead>
- <tbody>
- <% _.each( data.request_request, function( item, key ){ %>
- <tr>
- <td><%- key %></td>
- <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
- <% } %>
-
- <div class="panel__container">
- <h3>Request attributes</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Name'|t }}</th>
- <th>{{ 'Value'|t }}</th>
- </thead>
- <tbody>
- <% _.each( data.request_attributes, function( item, key ){ %>
- <tr>
- <td><%- key %></td>
- <% if(key == '_controller') { %>
- <td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
- <% } else if(key == '_form') { %>
- <td><%= Drupal.webprofiler.helpers.classLink(data.controller) %></td>
- <% } else { %>
- <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
- <% } %>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
-
- <% if (!_.isEmpty(data.request_cookies)) { %>
- <div class="panel__container">
- <h3>Cookies</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Name'|t }}</th>
- <th>{{ 'Value'|t }}</th>
- </thead>
- <tbody>
- <% _.each( data.request_cookies, function( item, key ){ %>
- <tr>
- <td><%- key %></td>
- <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
- <% } %>
-
- <div class="panel__container">
- <h3>Request headers</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Name'|t }}</th>
- <th>{{ 'Value'|t }}</th>
- </thead>
- <tbody>
- <% _.each( data.request_headers, function( item, key ){ %>
- <tr>
- <td><%- key %></td>
- <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
-
- <% if (!_.isEmpty(data.content)) { %>
- <div class="panel__container">
- <h3>Raw content</h3>
- <div class="h--word-broken"><%- data.content %></div>
- </div>
- <% } %>
-
- <% if (!_.isEmpty(data.access_check)) { %>
- <div class="panel__container">
- <h3>Access check</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Path'|t }}</th>
- <th>{{ 'Service'|t }}</th>
- </thead>
- <tbody>
- <% _.each(data.access_check, function(items, key){ %>
- <tr>
- <td><%- key %></td>
- <td>
- <% _.each(items, function(item){ %>
- <%- item.service_id %>
- <% }); %>
- </td>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
- <% } %>
-
- <div class="panel__container">
- <h3>Server Parameters</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Name'|t }}</th>
- <th>{{ 'Value'|t }}</th>
- </thead>
- <tbody>
- <% _.each( data.request_server, function( item, key ){ %>
- <tr>
- <td><%- key %></td>
- <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
-
- <div class="panel__container">
- <h3>Response headers</h3>
- <table class="table--duo">
- <thead>
- <th>{{ 'Name'|t }}</th>
- <th>{{ 'Value'|t }}</th>
- </thead>
- <tbody>
- <% _.each( data.response_headers, function( item, key ){ %>
- <tr>
- <td><%- key %></td>
- <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
- </tr>
- <% }); %>
- </tbody>
- </table>
- </div>
- </script>
- {% endblock %}