function FilterUrl::settingsForm

Same name in other branches
  1. 9 core/modules/filter/src/Plugin/Filter/FilterUrl.php \Drupal\filter\Plugin\Filter\FilterUrl::settingsForm()
  2. 8.9.x core/modules/filter/src/Plugin/Filter/FilterUrl.php \Drupal\filter\Plugin\Filter\FilterUrl::settingsForm()
  3. 10 core/modules/filter/src/Plugin/Filter/FilterUrl.php \Drupal\filter\Plugin\Filter\FilterUrl::settingsForm()

Overrides FilterBase::settingsForm

File

core/modules/filter/src/Plugin/Filter/FilterUrl.php, line 28

Class

FilterUrl
Provides a filter to convert URLs into links.

Namespace

Drupal\filter\Plugin\Filter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
    $form['filter_url_length'] = [
        '#type' => 'number',
        '#title' => $this->t('Maximum link text length'),
        '#default_value' => $this->settings['filter_url_length'],
        '#min' => 1,
        '#field_suffix' => $this->t('characters'),
        '#description' => $this->t('URLs longer than this number of characters will be truncated to prevent long strings that break formatting. The link itself will be retained; just the text portion of the link will be truncated.'),
    ];
    return $form;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.