You are here

protected function DrupalSliderViewsField::defineOptions in Drupal Slider 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/views/field/DrupalSliderViewsField.php \Drupal\drupal_slider\Plugin\views\field\DrupalSliderViewsField::defineOptions()

Define the available options.

Overrides FieldPluginBase::defineOptions

File

src/Plugin/views/field/DrupalSliderViewsField.php, line 30

Class

DrupalSliderViewsField
Field handler for Drupal Slider.

Namespace

Drupal\drupal_slider\Plugin\views\field

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['slide_options'] = [
    'default' => '',
  ];
  $options['background_img'] = [
    'default' => '',
  ];
  $config = \Drupal::config('drupal_slider.settings');
  $layers_count = $config
    ->get('ds_layers_count');
  for ($i = 1; $i <= $layers_count; $i++) {
    $options['layer_' . $i] = [
      'default' => '',
    ];
  }
  return $options;
}