ad0a86e8c81f9a2ecf01a2efe84c5bef9ee6717f
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / Form / FormTestCheckboxTypeJugglingForm.php
1 <?php
2
3 namespace Drupal\form_test\Form;
4
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Builds a form to test return values for checkboxes.
10  */
11 class FormTestCheckboxTypeJugglingForm extends FormBase {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function getFormId() {
17     return 'form_test_checkbox_type_juggling';
18   }
19
20   /**
21    * {@inheritdoc}
22    */
23   public function buildForm(array $form, FormStateInterface $form_state, $default_value = NULL, $return_value = NULL) {
24     $form['checkbox'] = [
25       '#title' => t('Checkbox'),
26       '#type' => 'checkbox',
27       '#return_value' => $return_value,
28       '#default_value' => $default_value,
29     ];
30     return $form;
31   }
32
33   /**
34    * {@inheritdoc}
35    */
36   public function submitForm(array &$form, FormStateInterface $form_state) {
37   }
38
39 }