public function MentionsSettingsForm::buildForm in Open Social 8
Same name and namespace in other branches
- 8.9 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 8.2 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 8.3 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 8.4 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 8.5 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 8.6 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 8.7 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 8.8 modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 10.3.x modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 10.0.x modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 10.1.x modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::buildForm()
- 10.2.x modules/custom/mentions/src/Form/MentionsSettingsForm.php \Drupal\mentions\Form\MentionsSettingsForm::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
- modules/
custom/ mentions/ src/ Form/ MentionsSettingsForm.php, line 62
Class
- MentionsSettingsForm
- Configure mentions settings.
Namespace
Drupal\mentions\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('mentions.settings');
$form['general'] = [
'#type' => 'details',
'#title' => $this
->t('General configuration'),
'#open' => TRUE,
];
$form['general']['supported_entity_types'] = [
'#title' => $this
->t('Supported entity types'),
'#type' => 'select',
'#multiple' => TRUE,
'#options' => $this
->getContentEntityTypes(),
'#default_value' => $config
->get('supported_entity_types'),
'#description' => $this
->t('Mentions entity will be created only for selected entity types.'),
];
return parent::buildForm($form, $form_state);
}