You are here

protected function Range::valueForm in Range 8

Options form subform for setting options.

This should be overridden by all child classes and it must define $form['value']

Overrides FilterPluginBase::valueForm

See also

buildOptionsForm()

File

src/Plugin/views/filter/Range.php, line 58

Class

Range
Range views filter.

Namespace

Drupal\range\Plugin\views\filter

Code

protected function valueForm(&$form, FormStateInterface $form_state) {
  $form['value'] = [
    '#type' => 'number',
    '#step' => 'any',
    '#title' => $this
      ->t('Value'),
    '#size' => 30,
    '#default_value' => $this->value,
  ];
  if (!$form_state
    ->get('exposed')) {
    $form['include_endpoints'] = [
      '#type' => 'checkbox',
      '#title' => $this
        ->t('Include endpoints'),
      '#default_value' => $this->options['include_endpoints'],
      '#description' => $this
        ->t('Whether to include endpoints or not.'),
    ];
  }
}