You are here

protected function ExposedFormPluginBase::defineOptions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase::defineOptions()
  2. 9 core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php \Drupal\views\Plugin\views\exposed_form\ExposedFormPluginBase::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides PluginBase::defineOptions

1 call to ExposedFormPluginBase::defineOptions()
InputRequired::defineOptions in core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
Information about options for all kinds of purposes will be held here.
1 method overrides ExposedFormPluginBase::defineOptions()
InputRequired::defineOptions in core/modules/views/src/Plugin/views/exposed_form/InputRequired.php
Information about options for all kinds of purposes will be held here.

File

core/modules/views/src/Plugin/views/exposed_form/ExposedFormPluginBase.php, line 26

Class

ExposedFormPluginBase
Base class for Views exposed filter form plugins.

Namespace

Drupal\views\Plugin\views\exposed_form

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['submit_button'] = [
    'default' => $this
      ->t('Apply'),
  ];
  $options['reset_button'] = [
    'default' => FALSE,
  ];
  $options['reset_button_label'] = [
    'default' => $this
      ->t('Reset'),
  ];
  $options['exposed_sorts_label'] = [
    'default' => $this
      ->t('Sort by'),
  ];
  $options['expose_sort_order'] = [
    'default' => TRUE,
  ];
  $options['sort_asc_label'] = [
    'default' => $this
      ->t('Asc'),
  ];
  $options['sort_desc_label'] = [
    'default' => $this
      ->t('Desc'),
  ];
  return $options;
}