Skip to content

Commit

Permalink
[WebProfiler] Add info to the router panel
Browse files Browse the repository at this point in the history
  • Loading branch information
vicb committed Feb 6, 2012
1 parent aa1676c commit 50c85ae
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 18 deletions.
Expand Up @@ -42,11 +42,11 @@ public function panelAction($token)
$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:&nbsp;</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>

0 comments on commit 50c85ae

Please sign in to comment.