class RssFeedsForm
Same name and namespace in other branches
- 11.x core/modules/system/src/Form/RssFeedsForm.php \Drupal\system\Form\RssFeedsForm
- 10 core/modules/system/src/Form/RssFeedsForm.php \Drupal\system\Form\RssFeedsForm
- 8.9.x core/modules/system/src/Form/RssFeedsForm.php \Drupal\system\Form\RssFeedsForm
Configure RSS settings for this site.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase implements \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Core\Form\ConfigFormBase uses \Drupal\Core\Form\ConfigFormBaseTrait extends \Drupal\Core\Form\FormBase
- class \Drupal\system\Form\RssFeedsForm extends \Drupal\Core\Form\ConfigFormBase
- class \Drupal\Core\Form\ConfigFormBase uses \Drupal\Core\Form\ConfigFormBaseTrait extends \Drupal\Core\Form\FormBase
Expanded class hierarchy of RssFeedsForm
1 string reference to 'RssFeedsForm'
- system.routing.yml in core/
modules/ system/ system.routing.yml - core/modules/system/system.routing.yml
File
-
core/
modules/ system/ src/ Form/ RssFeedsForm.php, line 13
Namespace
Drupal\system\FormView source
class RssFeedsForm extends ConfigFormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'system_rss_feeds_settings';
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return [
'system.rss',
];
}
/**
* {@inheritdoc}
*/
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);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->config('system.rss')
->set('items.view_mode', $form_state->getValue('feed_view_mode'))
->save();
parent::submitForm($form, $form_state);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.