public function VarbaseGeneralSettingsForm::buildForm in Varbase Core 8.6
Same name and namespace in other branches
- 8.8 src/Form/VarbaseGeneralSettingsForm.php \Drupal\varbase_core\Form\VarbaseGeneralSettingsForm::buildForm()
- 8.4 src/Form/VarbaseGeneralSettingsForm.php \Drupal\varbase_core\Form\VarbaseGeneralSettingsForm::buildForm()
- 8.5 src/Form/VarbaseGeneralSettingsForm.php \Drupal\varbase_core\Form\VarbaseGeneralSettingsForm::buildForm()
- 8.7 src/Form/VarbaseGeneralSettingsForm.php \Drupal\varbase_core\Form\VarbaseGeneralSettingsForm::buildForm()
- 9.0.x src/Form/VarbaseGeneralSettingsForm.php \Drupal\varbase_core\Form\VarbaseGeneralSettingsForm::buildForm()
Build the form.
Overrides ConfigFormBase::buildForm
File
- src/
Form/ VarbaseGeneralSettingsForm.php, line 30
Class
- VarbaseGeneralSettingsForm
- Provides form for managing module settings.
Namespace
Drupal\varbase_core\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
global $base_url;
$front_page_with_welcome = $base_url . '/?welcome';
$config = $this
->config('varbase_core.general_settings');
$form['settings']['welcome_status'] = [
'#type' => 'checkbox',
'#default_value' => $config
->get('welcome_status'),
'#title' => $this
->t('Allow site to show welcome message'),
'#description' => $this
->t('This option will allow to display Varbase\'s welcome message on the homepage by adding <code>?welcome</code> to the URL. This option is automatically disabled after closing the welcome message. Check this then navigate to <a href="@front_page_with_welcome">@front_page_with_welcome</a> to see the welcome message again.', [
'@front_page_with_welcome' => $front_page_with_welcome,
]),
];
return parent::buildForm($form, $form_state);
}