public function EventMaxEnrollSettingsForm::buildForm in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::buildForm()
- 8.5 modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::buildForm()
- 8.6 modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::buildForm()
- 8.8 modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::buildForm()
- 10.3.x modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::buildForm()
- 10.0.x modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::buildForm()
- 10.1.x modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::buildForm()
- 10.2.x modules/social_features/social_event/modules/social_event_max_enroll/src/Form/EventMaxEnrollSettingsForm.php \Drupal\social_event_max_enroll\Form\EventMaxEnrollSettingsForm::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/
social_features/ social_event/ modules/ social_event_max_enroll/ src/ Form/ EventMaxEnrollSettingsForm.php, line 32
Class
- EventMaxEnrollSettingsForm
- Class EventMaxEnrollSettingsForm.
Namespace
Drupal\social_event_max_enroll\FormCode
public function buildForm(array $form, FormStateInterface $form_state) {
$event_max_enroll_config = $this
->config('social_event_max_enroll.settings');
$form['max_enroll'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Enable maximum number of event enrollments'),
'#description' => $this
->t('Enabling this feature provides event organisers with the possibility to set a limit for event enrollments.'),
'#default_value' => $event_max_enroll_config
->get('max_enroll'),
];
$form['max_enroll_required'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Maximum event enrollments field is required'),
'#default_value' => $event_max_enroll_config
->get('max_enroll_required'),
'#states' => [
'visible' => [
'input[name="max_enroll"]' => [
'checked' => TRUE,
],
],
],
];
return parent::buildForm($form, $form_state);
}