TestContextualLink.php 449 Bytes
Newer Older
1 2 3 4 5
<?php

namespace Drupal\menu_test\Plugin\Menu\ContextualLink;

use Drupal\Core\Menu\ContextualLinkDefault;
6
use Symfony\Component\HttpFoundation\Request;
7 8 9 10 11 12 13 14 15

/**
 * Defines a contextual link plugin with a dynamic title from user input.
 */
class TestContextualLink extends ContextualLinkDefault {

  /**
   * {@inheritdoc}
   */
16
  public function getTitle(Request $request = NULL) {
17 18 19 20
    return "<script>alert('Welcome to the jungle!')</script>";
  }

}