You are here

public function AutoFloat::settingsForm in AutoFloat 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/AutoFloat.php, line 27

Class

AutoFloat
Provides a filter that wraps images in a selector with odd/even classes.

Namespace

Drupal\autofloat\Plugin\Filter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
  $url = Url::fromRoute('autofloat.settings');
  $config_link = Link::fromTextAndUrl($this
    ->t('AutoFloat Filter Settings'), $url)
    ->toString();
  $form['notice'] = [
    '#markup' => $this
      ->t('@config_link are shared by all the text formats where it is enabled.', [
      '@config_link' => $config_link,
    ]),
  ];
  return $form;
}