You are here

public function Range::buildOptionsForm in Range 8

Provide a form to edit options for this plugin.

Overrides ArgumentPluginBase::buildOptionsForm

File

src/Plugin/views/argument/Range.php, line 35

Class

Range
Range views argument.

Namespace

Drupal\range\Plugin\views\argument

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['operator'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Operator'),
    '#options' => [
      'within' => $this
        ->t('Range contains'),
      'not within' => $this
        ->t('Range does not contain'),
    ],
    '#default_value' => $this->options['operator'],
    '#group' => 'options][more',
  ];
  $form['include_endpoints'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Include endpoints'),
    '#default_value' => !empty($this->options['include_endpoints']),
    '#description' => $this
      ->t('Whether to include endpoints or not.'),
    '#group' => 'options][more',
  ];
}