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()
|
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()
|
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>
|
<h2>Routing for "{{ request.pathinfo }}"</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>Route: </strong>{{ request.route }}</li>
|
|
||||||
<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 %}
|
{% if request.routeParams|length %}
|
||||||
{% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': request.routeParams, 'class': 'inline' } only %}
|
{% include 'WebProfilerBundle:Profiler:table.html.twig' with { 'data': request.routeParams, 'class': 'inline' } only %}
|
||||||
{% else %}
|
{% else %}
|
||||||
@ -16,7 +23,7 @@
|
|||||||
<li>
|
<li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<li>
|
<li>
|
||||||
<strong>Route matching:</strong>
|
<strong>Route matching logs</strong>
|
||||||
<table class="routing inline">
|
<table class="routing inline">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Route name</th>
|
<th>Route name</th>
|
||||||
|
Reference in New Issue
Block a user