You are here

public function ConfigUpdateController::report in Configuration Update Manager 8

Generates the config updates report.

Parameters

string $report_type: (optional) Type of report to run:

  • type: Configuration entity type.
  • module: Module.
  • theme: Theme.
  • profile: Install profile.

string $name: (optional) Name of specific item to run report for (config entity type ID, module machine name, etc.). Ignored for profile.

Return value

array Render array for report, with section at the top for selecting another report to run. If either $report_type or $name is missing, the report itself is not generated.

1 string reference to 'ConfigUpdateController::report'
config_update_ui.routing.yml in config_update_ui/config_update_ui.routing.yml
config_update_ui/config_update_ui.routing.yml

File

config_update_ui/src/Controller/ConfigUpdateController.php, line 182

Class

ConfigUpdateController
Returns responses for Configuration Revert module operations.

Namespace

Drupal\config_update_ui\Controller

Code

public function report($report_type = NULL, $name = NULL) {
  $links = $this
    ->generateReportLinks();
  $report = $this
    ->generateReport($report_type, $name);
  if (!$report) {
    return $links;
  }

  // If there is a report, extract the title, put table of links in a
  // details element, and add report to build.
  $build = [];
  $build['#title'] = $report['#title'];
  unset($report['#title']);
  $build['links_wrapper'] = [
    '#type' => 'details',
    '#title' => $this
      ->t('Generate new report'),
    '#children' => $links,
  ];
  $build['report'] = $report;
  $build['#attached']['library'][] = 'config_update/report_css';
  return $build;
}