196d99cf40c4433492d4b20562a88ae0f095bba8
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / comment_links_alter.twig
1 /**
2  * Implements hook_comment_links_alter().
3  */
4 function {{ machine_name }}_comment_links_alter(array &$links, CommentInterface $entity, array &$context) {
5   $links['mymodule'] = [
6     '#theme' => 'links__comment__mymodule',
7     '#attributes' => ['class' => ['links', 'inline']],
8     '#links' => [
9       'comment-report' => [
10         'title' => t('Report'),
11         'url' => Url::fromRoute('comment_test.report', ['comment' => $entity->id()], ['query' => ['token' => \Drupal::getContainer()->get('csrf_token')->get("comment/{$entity->id()}/report")]]),
12       ],
13     ],
14   ];
15 }