[WebProfilerBundle] show the http method in wdt if not 'GET'

When the request method is different from 'GET', the wdt add a
hint before the route name in the request panel.
This commit is contained in:
Jules Pietri 2016-03-03 08:22:07 +01:00
parent 4f020b5686
commit 0a0e8afa09
2 changed files with 14 additions and 1 deletions

View File

@ -27,7 +27,7 @@
{% if collector.route %}
{% if collector.redirect %}{{ include('@WebProfiler/Icon/redirect.svg') }}{% endif %}
{% if collector.forward %}{{ include('@WebProfiler/Icon/forward.svg') }}{% endif %}
<span class="sf-toolbar-label">@</span>
<span class="sf-toolbar-label">{{ 'GET' != collector.method ? collector.method }} @</span>
<span class="sf-toolbar-value sf-toolbar-info-piece-additional">{{ collector.route }}</span>
{% endif %}
{% endset %}
@ -39,6 +39,13 @@
<span>{{ collector.statuscode }} {{ collector.statustext }}</span>
</div>
{% if 'GET' != collector.method -%}
<div class="sf-toolbar-info-piece">
<b>Method</b>
<span>{{ collector.method }}</span>
</div>
{%- endif %}
<div class="sf-toolbar-info-piece">
<b>Controller</b>
<span>{{ request_handler }}</span>

View File

@ -90,6 +90,7 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
$statusCode = $response->getStatusCode();
$this->data = array(
'method' => $request->getMethod(),
'format' => $request->getRequestFormat(),
'content' => $content,
'content_type' => $response->headers->get('Content-Type', 'text/html'),
@ -156,6 +157,11 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter
}
}
public function getMethod()
{
return $this->data['method'];
}
public function getPathInfo()
{
return $this->data['path_info'];