Version 1
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / Form / FormTestButtonClassForm.php
diff --git a/web/core/modules/system/tests/modules/form_test/src/Form/FormTestButtonClassForm.php b/web/core/modules/system/tests/modules/form_test/src/Form/FormTestButtonClassForm.php
new file mode 100644 (file)
index 0000000..4e3de3b
--- /dev/null
@@ -0,0 +1,43 @@
+<?php
+
+namespace Drupal\form_test\Form;
+
+use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Builds a simple form to test form button classes.
+ */
+class FormTestButtonClassForm extends FormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'form_test_button_class';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $form['button'] = [
+      '#type' => 'button',
+      '#value' => 'test',
+      '#button_type' => 'foo',
+    ];
+    $form['delete'] = [
+      '#type' => 'button',
+      '#value' => 'Delete',
+      '#button_type' => 'danger',
+    ];
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+  }
+
+}