You are here

public function ContentExportController::getContentType in Content Export CSV 8

* Get Content Type List

File

src/Controller/ContentExportController.php, line 12

Class

ContentExportController

Namespace

Drupal\content_export_csv\Controller

Code

public function getContentType() {
  $contentTypes = \Drupal::service('entity.manager')
    ->getStorage('node_type')
    ->loadMultiple();
  $contentTypesList = [];
  foreach ($contentTypes as $contentType) {
    $contentTypesList[$contentType
      ->id()] = $contentType
      ->label();
  }
  return $contentTypesList;
}