function OEmbedFormatter::settingsForm

Same name in other branches
  1. 9 core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\OEmbedFormatter::settingsForm()
  2. 10 core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\OEmbedFormatter::settingsForm()
  3. 11.x core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php \Drupal\media\Plugin\Field\FieldFormatter\OEmbedFormatter::settingsForm()

Overrides FormatterBase::settingsForm

File

core/modules/media/src/Plugin/Field/FieldFormatter/OEmbedFormatter.php, line 250

Class

OEmbedFormatter
Plugin implementation of the 'oembed' formatter.

Namespace

Drupal\media\Plugin\Field\FieldFormatter

Code

public function settingsForm(array $form, FormStateInterface $form_state) {
    return parent::settingsForm($form, $form_state) + [
        'max_width' => [
            '#type' => 'number',
            '#title' => $this->t('Maximum width'),
            '#default_value' => $this->getSetting('max_width'),
            '#size' => 5,
            '#maxlength' => 5,
            '#field_suffix' => $this->t('pixels'),
            '#min' => 0,
        ],
        'max_height' => [
            '#type' => 'number',
            '#title' => $this->t('Maximum height'),
            '#default_value' => $this->getSetting('max_height'),
            '#size' => 5,
            '#maxlength' => 5,
            '#field_suffix' => $this->t('pixels'),
            '#min' => 0,
        ],
    ];
}

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