You are here

public function FilterNoNbsp::settingsForm in No Non-breaking Space Filter 8

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/FilterNoNbsp.php, line 25

Class

FilterNoNbsp
Delete all non-breaking space HTML entities.

Namespace

Drupal\no_nbsp\Plugin\Filter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $form['preserve_placeholders'] = [
    '#type' => 'checkbox',
    '#title' => $this
      ->t('Preserve placeholders.'),
    '#default_value' => isset($this->settings['preserve_placeholders']) ? $this->settings['preserve_placeholders'] : FALSE,
    '#description' => $this
      ->t('A placeholder non-breaking space is surrounded by a HTML tag, for example <p> </p>.'),
  ];
  return $form;
}