Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / comment_links_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/comment_links_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/comment_links_alter.twig
new file mode 100644 (file)
index 0000000..196d99c
--- /dev/null
@@ -0,0 +1,15 @@
+/**
+ * Implements hook_comment_links_alter().
+ */
+function {{ machine_name }}_comment_links_alter(array &$links, CommentInterface $entity, array &$context) {
+  $links['mymodule'] = [
+    '#theme' => 'links__comment__mymodule',
+    '#attributes' => ['class' => ['links', 'inline']],
+    '#links' => [
+      'comment-report' => [
+        'title' => t('Report'),
+        'url' => Url::fromRoute('comment_test.report', ['comment' => $entity->id()], ['query' => ['token' => \Drupal::getContainer()->get('csrf_token')->get("comment/{$entity->id()}/report")]]),
+      ],
+    ],
+  ];
+}