protected function DrupalSliderViewsField::defineOptions in Drupal Slider 8
Same name and namespace in other branches
- 8.2 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\fieldCode
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;
}