You are here

public static function WebformContentCreatorUtilities::getFormattedContentTypes in Webform Content Creator 8

Same name and namespace in other branches
  1. 3.x src/WebformContentCreatorUtilities.php \Drupal\webform_content_creator\WebformContentCreatorUtilities::getFormattedContentTypes()

Get an associative array with content type ids and respective labels.

Return value

array Associative array with content type ids and labels.

1 call to WebformContentCreatorUtilities::getFormattedContentTypes()
WebformContentCreatorForm::form in src/Form/WebformContentCreatorForm.php
Gets the actual form array to be built.

File

src/WebformContentCreatorUtilities.php, line 253

Class

WebformContentCreatorUtilities
Provides useful functions required in Webform content creator module.

Namespace

Drupal\webform_content_creator

Code

public static function getFormattedContentTypes() {
  $contentTypes = self::getAllContentTypes();
  $contentTypes_formatted = [];
  foreach ($contentTypes as $k => $v) {
    $contentTypes_formatted[$k] = $v
      ->label();
  }
  return $contentTypes_formatted;
}