merged branch vicb/misc/cleaning (PR #3280)

Commits
-------

3896fdd [WebProfilerBundle] Some cleanup

Discussion
----------

[WebProfilerBundle] Some cleanup

former #3206 part 1 (misc cleanup)
This commit is contained in:
Fabien Potencier 2012-02-10 13:21:41 +01:00
commit 75c6ccf3b6
5 changed files with 41 additions and 30 deletions

View File

@ -37,7 +37,6 @@ class RequestDataCollector extends BaseRequestDataCollector
{
parent::collect($request, $response, $exception);
$this->data['route'] = $request->attributes->get('_route');
$this->data['controller'] = 'n/a';
if (isset($this->controllers[$request])) {
@ -71,7 +70,17 @@ class RequestDataCollector extends BaseRequestDataCollector
*/
public function getRoute()
{
return $this->data['route'];
return $this->data['request_attributes']['_route'];
}
/**
* Returns the route parameters.
*
* @return array The parameters
*/
public function getRouteParams()
{
return $this->data['request_attributes']['_route_params'];
}
/**

View File

@ -96,23 +96,7 @@
<h2>Session Attributes</h2>
{% if collector.sessionattributes|length %}
<table>
<thead>
<tr>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
{% set attributes = collector.sessionattributes %}
{% for key in attributes|keys|sort %}
<tr>
<th>{{ key }}</th>
<td>{{ attributes[key]|yaml_dump }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': collector.sessionattributes } only %}
{% else %}
<p>
<em>No session attributes</em>

View File

@ -1,16 +1,16 @@
<table>
<thead>
<tr>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
{% for key in bag.keys|sort %}
<table {% if class is defined %}class='{{ class }}'{% endif %} >
<thead>
<tr>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
{% for key in bag.keys|sort %}
<tr>
<th>{{ key }}</th>
<td>{{ bag.get(key)|yaml_dump }}</td>
</tr>
{% endfor %}
</tbody>
{% endfor %}
</tbody>
</table>

View File

@ -0,0 +1,16 @@
<table {% if class is defined %}class='{{ class }}'{% endif %} >
<thead>
<tr>
<th scope="col">Key</th>
<th scope="col">Value</th>
</tr>
</thead>
<tbody>
{% for key in data|keys|sort %}
<tr>
<th>{{ key }}</th>
<td>{{ data[key]|yaml_dump }}</td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -14,3 +14,5 @@
</tr>
{% endfor %}
</table>
<em><small>Note: The above matching is based on the configuration for the current router which might differ from
the configuration used while routing this request.</small></em>