Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / entity_operation.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/entity_operation.twig
new file mode 100644 (file)
index 0000000..e86fe35
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+ * Implements hook_entity_operation().
+ */
+function {{ machine_name }}_entity_operation(\Drupal\Core\Entity\EntityInterface $entity) {
+  $operations = [];
+  $operations['translate'] = [
+    'title' => t('Translate'),
+    'url' => \Drupal\Core\Url::fromRoute('foo_module.entity.translate'),
+    'weight' => 50,
+  ];
+
+  return $operations;
+}