Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / node_links_alter.twig
1 /**
2  * Implements hook_node_links_alter().
3  */
4 function {{ machine_name }}_node_links_alter(array &$links, NodeInterface $entity, array &$context) {
5   $links['mymodule'] = [
6     '#theme' => 'links__node__mymodule',
7     '#attributes' => ['class' => ['links', 'inline']],
8     '#links' => [
9       'node-report' => [
10         'title' => t('Report'),
11         'url' => Url::fromRoute('node_test.report', ['node' => $entity->id()], ['query' => ['token' => \Drupal::getContainer()->get('csrf_token')->get("node/{$entity->id()}/report")]]),
12       ],
13     ],
14   ];
15 }