public function SettingsForm::buildForm in Bootstrap Basic Image Gallery 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/ SettingsForm.php, line 57
Class
- SettingsForm
- Defines a form that configures Questions and Answers settings.
Namespace
Drupal\bootstrap_basic_image_gallery\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
// Get current settings.
$settings = $this
->config('bootstrap_basic_image_gallery.settings');
$form['prevent_load_bootstrap'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Prevent loading bootstrap scripts'),
'#default_value' => $settings
->get('prevent_load_bootstrap'),
'#description' => $this
->t('Uncheck this box to stop the module from loading Bootstrap files. This can be useful if you are using a theme that already loads the Bootstrap files. If this is occurring, when clicking the gallery image, the image appears on screen and then quickly disappears. This occurs because the modal script is loaded twice. Checking this box will disable the Bootstrap Image Gallery scripts and use the theme instead.'),
];
return parent::buildForm($form, $form_state);
}