You are here

private function HierarchicalTaxonomyMenuBlock::getImageStyleOptions in Hierarchical Taxonomy Menu 8

Generates image style select options.

1 call to HierarchicalTaxonomyMenuBlock::getImageStyleOptions()
HierarchicalTaxonomyMenuBlock::blockForm in src/Plugin/Block/HierarchicalTaxonomyMenuBlock.php

File

src/Plugin/Block/HierarchicalTaxonomyMenuBlock.php, line 808

Class

HierarchicalTaxonomyMenuBlock
Provides a 'HierarchicalTaxonomyMenuBlock' block.

Namespace

Drupal\hierarchical_taxonomy_menu\Plugin\Block

Code

private function getImageStyleOptions() {
  $options = [];
  $styles = $this->entityTypeManager
    ->getStorage('image_style')
    ->loadMultiple();
  foreach ($styles as $style) {

    /** @var \Drupal\image\Entity\ImageStyle $style */
    $style_name = $style
      ->getName();
    $options[$style_name] = $style
      ->label();
  }
  return $options;
}