You are here

public function WeightSelector::buildOptionsForm in Weight 8.3

Default options form that provides the label widget that all fields should have.

Overrides FieldPluginBase::buildOptionsForm

File

src/Plugin/views/field/WeightSelector.php, line 62

Class

WeightSelector
Field handler to present a weight selector element.

Namespace

Drupal\weight\Plugin\views\field

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['range'] = [
    '#type' => 'textfield',
    '#title' => $this
      ->t('Range'),
    '#description' => $this
      ->t('The range of weights available to select. For
        example, a range of 20 will allow you to select a weight between -20
        and 20.'),
    '#default_value' => $this->options['range'],
    '#size' => 5,
  ];
}