You are here

public function YandexMetricsReportsController::ajax in Yandex.Metrics 8.2

Menu callback; outputs content of one of the 4 reports. It is intended for AJAX calls.

Parameters

$counter_id:

$filter:

$type:

Return value

void

1 string reference to 'YandexMetricsReportsController::ajax'
yandex_metrics_reports.routing.yml in yandex_metrics_reports/yandex_metrics_reports.routing.yml
yandex_metrics_reports/yandex_metrics_reports.routing.yml

File

yandex_metrics_reports/src/Controller/YandexMetricsReportsController.php, line 137
Contains \Drupal\action\Controller\YandexMetricsReportsController

Class

YandexMetricsReportsController
Universal controller for yandex_metrics_reports module.

Namespace

Drupal\yandex_metrics_reports\Controller

Code

public function ajax($counter_id, $filter, $type) {
  $output = '';
  $reports = yandex_metrics_reports_get_list();
  if (isset($reports[$type]) && isset($reports[$type]['callback']) && function_exists($reports[$type]['callback'])) {
    $output = call_user_func($reports[$type]['callback'], $counter_id, $filter);
  }
  echo $output;
  die;
}