You are here

public function TestContextualLink::getTitle in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.php \Drupal\menu_test\Plugin\Menu\ContextualLink\TestContextualLink::getTitle()

Returns the localized title to be shown for this contextual link.

Subclasses may add optional arguments like NodeInterface $node = NULL that will be supplied by the ControllerResolver.

Return value

string The title to be shown for this action.

Overrides ContextualLinkDefault::getTitle

See also

\Drupal\Core\Menu\ContextualLinksManager::getTitle()

File

core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.php, line 20
Contains \Drupal\menu_test\Plugin\Menu\ContextualLink\TestContextualLink.

Class

TestContextualLink
Defines a contextual link plugin with a dynamic title from user input.

Namespace

Drupal\menu_test\Plugin\Menu\ContextualLink

Code

public function getTitle() {
  return "<script>alert('Welcome to the jungle!')</script>";
}