You are here

public function ApiTokensFilter::settingsForm in API Tokens 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Filter/ApiTokensFilter.php \Drupal\api_tokens\Plugin\Filter\ApiTokensFilter::settingsForm()

Generates a filter's settings form.

Parameters

array $form: A minimally prepopulated form array.

\Drupal\Core\Form\FormStateInterface $form_state: The state of the (entire) configuration form.

Return value

array The $form array with additional form elements for the settings of this filter. The submitted form values should match $this->settings.

Overrides FilterBase::settingsForm

File

src/Plugin/Filter/ApiTokensFilter.php, line 71

Class

ApiTokensFilter
Provides the API tokens filter.

Namespace

Drupal\api_tokens\Plugin\Filter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['unregistered_tokens_behavior'] = [
    '#type' => 'radios',
    '#title' => $this
      ->t('Unregistered API tokens process behavior'),
    '#default_value' => $this->settings['unregistered_tokens_behavior'],
    '#options' => [
      'cutout' => $this
        ->t('Cut out'),
      'ignore' => $this
        ->t('Ignore'),
    ],
  ];
  return $form;
}