You are here

public function DisplayTest::optionsSummary in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php \Drupal\views_test_data\Plugin\views\display\DisplayTest::optionsSummary()

Provides the default summary for options in the views UI.

This output is returned as an array.

Overrides DisplayPluginBase::optionsSummary

File

core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php, line 50

Class

DisplayTest
Defines a Display test plugin.

Namespace

Drupal\views_test_data\Plugin\views\display

Code

public function optionsSummary(&$categories, &$options) {
  parent::optionsSummary($categories, $options);
  $categories['display_test'] = [
    'title' => $this
      ->t('Display test settings'),
    'column' => 'second',
    'build' => [
      '#weight' => -100,
    ],
  ];
  $test_option = $this
    ->getOption('test_option') ?: $this
    ->t('Empty');
  $options['test_option'] = [
    'category' => 'display_test',
    'title' => $this
      ->t('Test option'),
    'value' => views_ui_truncate($test_option, 24),
  ];
}