public function SettingsForm::buildForm in bootstrap simple carousel 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 73
Class
- SettingsForm
- Class SettingsForm.
Namespace
Drupal\bootstrap_simple_carousel\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$config = $this
->config('bootstrap_simple_carousel.settings');
$form['interval'] = [
'#type' => 'textfield',
'#title' => $this
->t('Interval'),
'#description' => $this
->t('The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.'),
'#default_value' => $config
->get('interval'),
];
$form['wrap'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Wrap'),
'#description' => $this
->t('Whether the carousel should cycle continuously or have hard stops.'),
'#default_value' => $config
->get('wrap'),
];
$form['pause'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Pause on hover'),
'#description' => $this
->t("If is checked, pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. If is unchecked, hovering over the carousel won't pause it."),
'#default_value' => $config
->get('pause'),
];
$form['indicators'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Indicators'),
'#description' => $this
->t('Show carousel indicators'),
'#default_value' => $config
->get('indicators'),
];
$form['controls'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Controls'),
'#description' => $this
->t('Show carousel arrows (next/prev).'),
'#default_value' => $config
->get('controls'),
];
$form['assets'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Assets'),
'#description' => $this
->t("Includes bootstrap framework v4.0.0, don't check it, if you use the bootstrap theme, or the bootstrap framework are already included."),
'#default_value' => $config
->get('assets'),
];
$form['image_type'] = [
'#type' => 'select',
'#title' => $this
->t('Bootstrap image type'),
'#description' => $this
->t('Bootstrap image type for carousel items.'),
'#options' => $this
->getImagesTypes(),
'#default_value' => $config
->get('image_type'),
];
$form['image_style'] = [
'#type' => 'select',
'#title' => $this
->t('Image style'),
'#description' => $this
->t('Image style for carousel items. If you will be use the image styles for bootstrap items, you need to set up the same width for the "bootstrap carousel" container.'),
'#options' => $this
->getImagesStyles(),
'#default_value' => $config
->get('image_style'),
];
return parent::buildForm($form, $form_state);
}