Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / Form / FormTestPlaceholderForm.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 the placeholder attribute.
10  *
11  * @internal
12  */
13 class FormTestPlaceholderForm extends FormBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getFormId() {
19     return 'form_test_placeholder_test';
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   public function buildForm(array $form, FormStateInterface $form_state) {
26     foreach (['textfield', 'textarea', 'url', 'password', 'search', 'tel', 'email', 'number'] as $type) {
27       $form[$type] = [
28         '#type' => $type,
29         '#title' => $type,
30         '#placeholder' => 'placeholder-text',
31       ];
32     }
33
34     return $form;
35   }
36
37   /**
38    * {@inheritdoc}
39    */
40   public function submitForm(array &$form, FormStateInterface $form_state) {
41   }
42
43 }