You are here

public function NumericArgument::buildOptionsForm in Drupal 9

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

Provide a form to edit options for this plugin.

Overrides ArgumentPluginBase::buildOptionsForm

1 call to NumericArgument::buildOptionsForm()
NumberListField::buildOptionsForm in core/modules/options/src/Plugin/views/argument/NumberListField.php
Provide a form to edit options for this plugin.
1 method overrides NumericArgument::buildOptionsForm()
NumberListField::buildOptionsForm in core/modules/options/src/Plugin/views/argument/NumberListField.php
Provide a form to edit options for this plugin.

File

core/modules/views/src/Plugin/views/argument/NumericArgument.php, line 39

Class

NumericArgument
Basic argument handler for arguments that are numeric. Incorporates break_phrase.

Namespace

Drupal\views\Plugin\views\argument

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);

  // allow + for or, , for and
  $form['break_phrase'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Allow multiple values'),
    '#description' => $this
      ->t('If selected, users can enter multiple values in the form of 1+2+3 (for OR) or 1,2,3 (for AND).'),
    '#default_value' => !empty($this->options['break_phrase']),
    '#group' => 'options][more',
  ];
  $form['not'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Exclude'),
    '#description' => $this
      ->t('If selected, the numbers entered for the filter will be excluded rather than limiting the view.'),
    '#default_value' => !empty($this->options['not']),
    '#group' => 'options][more',
  ];
}