[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);
|
$profile = $profiler->loadProfile($token);
|
||||||
|
|
||||||
$matcher = new TraceableUrlMatcher($router->getRouteCollection(), $router->getContext());
|
$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(
|
return $this->container->get('templating')->renderResponse('WebProfilerBundle:Router:panel.html.twig', array(
|
||||||
'pathinfo' => $pathinfo,
|
'request' => $request,
|
||||||
'traces' => $matcher->getTraces($pathinfo),
|
'traces' => $matcher->getTraces($request->getPathInfo()),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,26 @@
|
|||||||
<h2>Routing for "{{ pathinfo }}"</h2>
|
<h2>Routing for "{{ request.pathinfo }}"</h2>
|
||||||
|
|
||||||
<table class="routing">
|
<ul>
|
||||||
<tr>
|
<li><strong>Route: </strong>{{ request.route }}</li>
|
||||||
<th>Route name</th>
|
<li>
|
||||||
<th>Pattern</th>
|
<strong>Route parameters:</strong>
|
||||||
<th>Log</th>
|
{% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': request.routeParams } only %}
|
||||||
</tr>
|
</li>
|
||||||
{% for trace in traces %}
|
|
||||||
<tr class="{{ 1 == trace.level ? 'almost' : 2 == trace.level ? 'matches' : '' }}">
|
<li>
|
||||||
<td>{{ trace.name }}</td>
|
<strong>Route matching:</strong>
|
||||||
<td>{{ trace.pattern }}</td>
|
<table class="routing">
|
||||||
<td>{{ trace.log }}</td>
|
<tr>
|
||||||
</tr>
|
<th>Route name</th>
|
||||||
{% endfor %}
|
<th>Pattern</th>
|
||||||
</table>
|
<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