You are here

public function ConfigInspectorController::download in Configuration Inspector 8

Download raw data.

Parameters

string $name: Configuration name.

Return value

\Symfony\Component\HttpFoundation\Response Return config as a response yaml file.

1 string reference to 'ConfigInspectorController::download'
config_inspector.routing.yml in ./config_inspector.routing.yml
config_inspector.routing.yml

File

src/Controller/ConfigInspectorController.php, line 293

Class

ConfigInspectorController
Defines a controller for the config_inspector module.

Namespace

Drupal\config_inspector\Controller

Code

public function download($name) {
  $data = $this->configInspectorManager
    ->getConfigData($name);
  $data = Yaml::encode($data);
  $headers = [
    'Content-disposition' => 'attachment; filename="' . $name . '.yml"',
  ];
  return new Response($data, 200, $headers);
}