You are here

public function Hits::display in Visitors 8.2

Returns a hits page.

Return value

array A render array representing the hits page content.

1 string reference to 'Hits::display'
visitors.routing.yml in ./visitors.routing.yml
visitors.routing.yml

File

src/Controller/Report/Hits.php, line 64
Contains Drupal\visitors\Controller\Report\Hits.

Class

Hits

Namespace

Drupal\visitors\Controller\Report

Code

public function display($host) {
  $form = $this->formBuilder
    ->getForm('Drupal\\visitors\\Form\\DateFilter');
  $header = $this
    ->_getHeader();
  return array(
    '#title' => Html::escape(t('Hits from') . ' ' . $host),
    'visitors_date_filter_form' => $form,
    'visitors_table' => array(
      '#type' => 'table',
      '#header' => $header,
      '#rows' => $this
        ->_getData($header, $host),
    ),
    'visitors_pager' => array(
      '#type' => 'pager',
    ),
  );
}