public function DashboardController::restCollectorAction in Devel 8
Same name and namespace in other branches
- 8.3 webprofiler/src/Controller/DashboardController.php \Drupal\webprofiler\Controller\DashboardController::restCollectorAction()
- 8.2 webprofiler/src/Controller/DashboardController.php \Drupal\webprofiler\Controller\DashboardController::restCollectorAction()
- 4.x webprofiler/src/Controller/DashboardController.php \Drupal\webprofiler\Controller\DashboardController::restCollectorAction()
Exposes collector's data as JSON.
Parameters
\Symfony\Component\HttpKernel\Profiler\Profile $profile:
$collector:
Return value
\Symfony\Component\HttpFoundation\JsonResponse
1 string reference to 'DashboardController::restCollectorAction'
- webprofiler.routing.yml in webprofiler/
webprofiler.routing.yml - webprofiler/webprofiler.routing.yml
File
- webprofiler/
src/ Controller/ DashboardController.php, line 236
Class
- DashboardController
- Class DashboardController
Namespace
Drupal\webprofiler\ControllerCode
public function restCollectorAction(Profile $profile, $collector) {
$this->profiler
->disable();
$data = $profile
->getCollector($collector)
->getData();
return new JsonResponse([
'data' => $data,
]);
}