Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_attach_form.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_form.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_attach_form.twig
new file mode 100644 (file)
index 0000000..a8cacbd
--- /dev/null
@@ -0,0 +1,11 @@
+/**
+ * Implements hook_field_attach_form().
+ */
+function {{ machine_name }}_field_attach_form($entity_type, $entity, &$form, &$form_state, $langcode) {
+  // Add a checkbox allowing a given field to be emptied.
+  // See hook_field_attach_submit() for the corresponding processing code.
+  $form['empty_field_foo'] = array(
+    '#type' => 'checkbox',
+    '#title' => t("Empty the 'field_foo' field"),
+  );
+}