Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NullArgument.php

function NullArgument::buildOptionsForm

Overrides ArgumentPluginBase::buildOptionsForm

File

core/modules/views/src/Plugin/views/argument/NullArgument.php, line 27

Class

NullArgument
Argument handler that ignores the argument.

Namespace

Drupal\views\Plugin\views\argument

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $form['must_not_be'] = [
        '#type' => 'checkbox',
        '#title' => $this->t('Fail basic validation if any argument is given'),
        '#default_value' => !empty($this->options['must_not_be']),
        '#description' => $this->t('By checking this field, you can use this to make sure views with more arguments than necessary fail validation.'),
        '#group' => 'options][more',
    ];
    unset($form['exception']);
}
RSS feed
Powered by Drupal