You are here

public function NumberListField::buildOptionsForm in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/options/src/Plugin/views/argument/NumberListField.php \Drupal\options\Plugin\views\argument\NumberListField::buildOptionsForm()
  2. 10 core/modules/options/src/Plugin/views/argument/NumberListField.php \Drupal\options\Plugin\views\argument\NumberListField::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides NumericArgument::buildOptionsForm

File

core/modules/options/src/Plugin/views/argument/NumberListField.php, line 56

Class

NumberListField
Argument handler for list field to show the human readable name in the summary.

Namespace

Drupal\options\Plugin\views\argument

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  $form['summary']['human'] = [
    '#title' => $this
      ->t('Display list value as human readable'),
    '#type' => 'checkbox',
    '#default_value' => $this->options['summary']['human'],
    '#states' => [
      'visible' => [
        ':input[name="options[default_action]"]' => [
          'value' => 'summary',
        ],
      ],
    ],
  ];
}