public function RoutingDataCollector::collect in Devel 8.3
Same name and namespace in other branches
- 8 webprofiler/src/DataCollector/RoutingDataCollector.php \Drupal\webprofiler\DataCollector\RoutingDataCollector::collect()
- 8.2 webprofiler/src/DataCollector/RoutingDataCollector.php \Drupal\webprofiler\DataCollector\RoutingDataCollector::collect()
- 4.x webprofiler/src/DataCollector/RoutingDataCollector.php \Drupal\webprofiler\DataCollector\RoutingDataCollector::collect()
File
- webprofiler/
src/ DataCollector/ RoutingDataCollector.php, line 39
Class
- RoutingDataCollector
- Provides a data collector which shows all available routes.
Namespace
Drupal\webprofiler\DataCollectorCode
public function collect(Request $request, Response $response, \Exception $exception = NULL) {
$this->data['routing'] = [];
foreach ($this->routeProvider
->getAllRoutes() as $route_name => $route) {
// @TODO Find a better visual representation.
$this->data['routing'][] = [
'name' => $route_name,
'path' => $route
->getPath(),
];
}
}