You are here

public static function WebformContentCreatorUtilities::getFormattedContentTypes in Webform Content Creator 3.x

Same name and namespace in other branches
  1. 8 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() {
  $content_types = self::getAllContentTypes();
  $result = [];
  foreach ($content_types as $k => $v) {
    $result[$k] = $v
      ->label();
  }
  return $result;
}