[WebProfiler] Add info to the router panel
This commit is contained in:
parent
aa1676c7b5
commit
50c85aef24
@ -42,11 +42,11 @@ class RouterController extends ContainerAware
|
||||
$profile = $profiler->loadProfile($token);
|
||||
|
||||
$matcher = new TraceableUrlMatcher($router->getRouteCollection(), $router->getContext());
|
||||
$pathinfo = $profile->getCollector('request')->getPathInfo();
|
||||
$request = $profile->getCollector('request');
|
||||
|
||||
return $this->container->get('templating')->renderResponse('WebProfilerBundle:Router:panel.html.twig', array(
|
||||
'pathinfo' => $pathinfo,
|
||||
'traces' => $matcher->getTraces($pathinfo),
|
||||
'request' => $request,
|
||||
'traces' => $matcher->getTraces($request->getPathInfo()),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,26 @@
|
||||
<h2>Routing for "{{ pathinfo }}"</h2>
|
||||
<h2>Routing for "{{ request.pathinfo }}"</h2>
|
||||
|
||||
<table class="routing">
|
||||
<tr>
|
||||
<th>Route name</th>
|
||||
<th>Pattern</th>
|
||||
<th>Log</th>
|
||||
</tr>
|
||||
{% for trace in traces %}
|
||||
<tr class="{{ 1 == trace.level ? 'almost' : 2 == trace.level ? 'matches' : '' }}">
|
||||
<td>{{ trace.name }}</td>
|
||||
<td>{{ trace.pattern }}</td>
|
||||
<td>{{ trace.log }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<ul>
|
||||
<li><strong>Route: </strong>{{ request.route }}</li>
|
||||
<li>
|
||||
<strong>Route parameters:</strong>
|
||||
{% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': request.routeParams } only %}
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<strong>Route matching:</strong>
|
||||
<table class="routing">
|
||||
<tr>
|
||||
<th>Route name</th>
|
||||
<th>Pattern</th>
|
||||
<th>Log</th>
|
||||
</tr>
|
||||
{% for trace in traces %}
|
||||
<tr class="{{ 1 == trace.level ? 'almost' : 2 == trace.level ? 'matches' : '' }}">
|
||||
<td>{{ trace.name }}</td>
|
||||
<td>{{ trace.pattern }}</td>
|
||||
<td>{{ trace.log }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</li>
|
Reference in New Issue
Block a user