public function RssNews::buildSettingsForm in Dashboards with Layout Builder 8
Same name and namespace in other branches
- 2.0.x src/Plugin/Dashboard/RssNews.php \Drupal\dashboards\Plugin\Dashboard\RssNews::buildSettingsForm()
Build render array.
Parameters
array $form: Default form.
\Drupal\Core\Form\FormStateInterface $form_state: Default form.
array $configuration: Configuration.
Return value
array Return form array.
Overrides DashboardBase::buildSettingsForm
File
- src/
Plugin/ Dashboard/ RssNews.php, line 67
Class
- RssNews
- Show account info.
Namespace
Drupal\dashboards\Plugin\DashboardCode
public function buildSettingsForm(array $form, FormStateInterface $form_state, array $configuration) : array {
$form['uri'] = [
'#type' => 'url',
'#title' => $this
->t('Feed URL or website url'),
'#default_value' => isset($configuration['uri']) ? $configuration['uri'] : '',
];
$form['max_items'] = [
'#type' => 'number',
'#title' => $this
->t('How many items to display'),
'#default_value' => isset($configuration['max_items']) ? $configuration['max_items'] : 5,
];
$form['show_description'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Show description'),
'#default_value' => isset($configuration['show_description']) ? $configuration['show_description'] : 5,
];
return $form;
}