You are here

public function BlogapiCommunicator::getTextFormats in Blog API 8

Helper that returns all available text formats.

Return value

array An array of available formats.

File

src/BlogapiCommunicator.php, line 718

Class

BlogapiCommunicator
Class BlogapiCommunicator.

Namespace

Drupal\blogapi

Code

public function getTextFormats() {
  $plugins = filter_formats();
  $filters = [];
  foreach ($plugins as $format) {
    $filter['key'] = $format
      ->id();
    $filter['label'] = $format
      ->get('name');
    $filters[] = $filter;
  }
  return $filters;
}