Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / module / content-entity / src / Form / ExampleSettingsForm.php.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleSettingsForm.php.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/module/content-entity/src/Form/ExampleSettingsForm.php.twig
new file mode 100644 (file)
index 0000000..d9f4c3c
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+namespace Drupal\{{ machine_name }}\Form;
+
+use Drupal\Core\Form\FormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Configuration form for {{ entity_type_label|article|lower }} entity type.
+ */
+class {{ class_prefix }}SettingsForm extends FormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return '{{ entity_type_id }}_settings';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+
+    $form['settings'] = [
+      '#markup' => $this->t('Settings form for {{ entity_type_label|article|lower }} entity type.'),
+    ];
+
+    $form['actions'] = [
+      '#type' => 'actions',
+    ];
+
+    $form['actions']['submit'] = [
+      '#type' => 'submit',
+      '#value' => $this->t('Save'),
+    ];
+
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    drupal_set_message($this->t('The configuration has been updated.'));
+  }
+
+}