You are here

public function RssFeedsForm::buildForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/src/Form/RssFeedsForm.php \Drupal\system\Form\RssFeedsForm::buildForm()
  2. 9 core/modules/system/src/Form/RssFeedsForm.php \Drupal\system\Form\RssFeedsForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

core/modules/system/src/Form/RssFeedsForm.php, line 32

Class

RssFeedsForm
Configure RSS settings for this site.

Namespace

Drupal\system\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form['feed_view_mode'] = [
    '#type' => 'select',
    '#title' => $this
      ->t('Feed content'),
    '#default_value' => $this
      ->config('system.rss')
      ->get('items.view_mode'),
    '#options' => [
      'title' => $this
        ->t('Titles only'),
      'teaser' => $this
        ->t('Titles plus teaser'),
      'fulltext' => $this
        ->t('Full text'),
    ],
    '#description' => $this
      ->t('Global setting for the default display of content items in each feed.'),
  ];
  return parent::buildForm($form, $form_state);
}