fixed exception in the profile/WDT when no route matches
This commit is contained in:
parent
1e79e30c7b
commit
8365675fc2
@ -70,7 +70,7 @@ class RequestDataCollector extends BaseRequestDataCollector
|
||||
*/
|
||||
public function getRoute()
|
||||
{
|
||||
return $this->data['request_attributes']['_route'];
|
||||
return isset($this->data['request_attributes']['_route']) ? $this->data['request_attributes']['_route'] : '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -80,7 +80,7 @@ class RequestDataCollector extends BaseRequestDataCollector
|
||||
*/
|
||||
public function getRouteParams()
|
||||
{
|
||||
return $this->data['request_attributes']['_route_params'];
|
||||
return isset($this->data['request_attributes']['_route_params']) ? $this->data['request_attributes']['_route_params'] : array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,9 +1,16 @@
|
||||
<h2>Routing for "{{ request.pathinfo }}"</h2>
|
||||
|
||||
<ul>
|
||||
<li><strong>Route: </strong>{{ request.route }}</li>
|
||||
<li>
|
||||
<strong>Route parameters:</strong>
|
||||
<strong>Route: </strong>
|
||||
{% if request.route %}
|
||||
{{ request.route }}
|
||||
{% else %}
|
||||
<em>No matching route</em>
|
||||
{% endif %}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Route parameters: </strong>
|
||||
{% if request.routeParams|length %}
|
||||
{% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': request.routeParams, 'class': 'inline' } only %}
|
||||
{% else %}
|
||||
@ -16,7 +23,7 @@
|
||||
<li>
|
||||
{% endif %}
|
||||
<li>
|
||||
<strong>Route matching:</strong>
|
||||
<strong>Route matching logs</strong>
|
||||
<table class="routing inline">
|
||||
<tr>
|
||||
<th>Route name</th>
|
||||
|
Reference in New Issue
Block a user