public function ComponentsSettingsForm::buildForm in Components! 8
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
- src/
Form/ ComponentsSettingsForm.php, line 39 - Contains \Drupal\components\Form\ComponentSettingsForm.
Class
- ComponentsSettingsForm
- Configure components settings for this site.
Namespace
Drupal\components\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config(static::SETTINGS);
$messenger = \Drupal::messenger();
$messenger
->addMessage(t('Be sure to update any theme or module namespaces before enabling.'), $messenger::TYPE_WARNING);
$form['namespace_prefix'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Prefix Module or Theme Name in Namespace'),
'#default_value' => $config
->get('namespace_prefix'),
];
return parent::buildForm($form, $form_state);
}