You are here

protected function BaseLayoutBase::getBackgroundImageStyleOptions in Layout Builder Base 8

Gets the background image style options for the configuration form.

Return value

string[] The background image style options array where the keys are strings that will be added to the CSS classes and the values are the human readable labels.

1 call to BaseLayoutBase::getBackgroundImageStyleOptions()
BaseLayoutBase::buildConfigurationForm in src/Plugin/Layout/BaseLayoutBase.php
Form constructor.

File

src/Plugin/Layout/BaseLayoutBase.php, line 979

Class

BaseLayoutBase
Configurable layout plugin class.

Namespace

Drupal\layout_builder_base\Plugin\Layout

Code

protected function getBackgroundImageStyleOptions() {
  $image_styles = ImageStyle::loadMultiple();
  $options = [
    '' => $this
      ->t('None'),
  ];
  foreach ($image_styles as $style) {
    $options[$style
      ->id()] = $style
      ->label();
  }
  return $options;
}