You are here

public function HtmlList::buildOptionsForm in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/style/HtmlList.php \Drupal\views\Plugin\views\style\HtmlList::buildOptionsForm()

Render the given style.

Overrides StylePluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/style/HtmlList.php, line 50

Class

HtmlList
Style plugin to render each item in an ordered or unordered list.

Namespace

Drupal\views\Plugin\views\style

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['type'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('List type'),
    '#options' => [
      'ul' => $this
        ->t('Unordered list'),
      'ol' => $this
        ->t('Ordered list'),
    ],
    '#default_value' => $this->options['type'],
  ];
  $form['wrapper_class'] = [
    '#title' => $this
      ->t('Wrapper class'),
    '#description' => $this
      ->t('The class to provide on the wrapper, outside the list.'),
    '#type' => 'textfield',
    '#size' => '30',
    '#default_value' => $this->options['wrapper_class'],
  ];
  $form['class'] = [
    '#title' => $this
      ->t('List class'),
    '#description' => $this
      ->t('The class to provide on the list element itself.'),
    '#type' => 'textfield',
    '#size' => '30',
    '#default_value' => $this->options['class'],
  ];
}