You are here

public function DetailController::build in MongoDB 8.2

Controller.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The current request.

\Drupal\mongodb_watchdog\EventTemplate $eventTemplate: The event template.

Return value

array A render array.

1 string reference to 'DetailController::build'
mongodb_watchdog.routing.yml in modules/mongodb_watchdog/mongodb_watchdog.routing.yml
modules/mongodb_watchdog/mongodb_watchdog.routing.yml

File

modules/mongodb_watchdog/src/Controller/DetailController.php, line 66

Class

DetailController
The controller for the event detail page.

Namespace

Drupal\mongodb_watchdog\Controller

Code

public function build(Request $request, EventTemplate $eventTemplate) : array {
  $top = $this
    ->getTop($eventTemplate);
  $rows = $this
    ->getRowData($request, $eventTemplate);
  $main = empty($rows) ? $this
    ->buildEmpty($this
    ->t('No occurrence of this event found in logger.')) : $this
    ->buildMainTable($rows, $eventTemplate);
  $ret = $this
    ->buildDefaults($main, $top);
  return $ret;
}