You are here

public function YamlFormPluginExporterController::index in YAML Form 8

1 string reference to 'YamlFormPluginExporterController::index'
yamlform.routing.yml in ./yamlform.routing.yml
yamlform.routing.yml

File

src/Controller/YamlFormPluginExporterController.php, line 44

Class

YamlFormPluginExporterController
Controller for all results exporters.

Namespace

Drupal\yamlform\Controller

Code

public function index() {
  $definitions = $this->pluginManager
    ->getDefinitions();
  $definitions = $this->pluginManager
    ->getSortedDefinitions($definitions);
  $rows = [];
  foreach ($definitions as $plugin_id => $definition) {
    $rows[$plugin_id] = [
      $plugin_id,
      $definition['label'],
      $definition['description'],
      $definition['provider'],
    ];
  }
  ksort($rows);
  return [
    '#type' => 'table',
    '#header' => [
      $this
        ->t('ID'),
      $this
        ->t('Label'),
      $this
        ->t('Description'),
      $this
        ->t('Provided by'),
    ],
    '#rows' => $rows,
    '#sticky' => TRUE,
  ];
}