You are here

class TestContextualLink in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.php \Drupal\menu_test\Plugin\Menu\ContextualLink\TestContextualLink
  2. 9 core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.php \Drupal\menu_test\Plugin\Menu\ContextualLink\TestContextualLink

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

Hierarchy

Expanded class hierarchy of TestContextualLink

1 string reference to 'TestContextualLink'
menu_test.links.contextual.yml in core/modules/system/tests/modules/menu_test/menu_test.links.contextual.yml
core/modules/system/tests/modules/menu_test/menu_test.links.contextual.yml

File

core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.php, line 11

Namespace

Drupal\menu_test\Plugin\Menu\ContextualLink
View source
class TestContextualLink extends ContextualLinkDefault {

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

}

Members

Namesort descending Modifiers Type Description Overrides
ContextualLinkDefault::getGroup public function
ContextualLinkDefault::getOptions public function
ContextualLinkDefault::getRouteName public function
ContextualLinkDefault::getWeight public function
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$pluginDefinition protected property The plugin implementation definition.
PluginBase::$pluginId protected property The plugin_id.
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::getBaseId public function
PluginBase::getDerivativeId public function
PluginBase::getPluginDefinition public function 2
PluginBase::getPluginId public function
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 53
TestContextualLink::getTitle public function Returns the localized title to be shown for this contextual link. Overrides ContextualLinkDefault::getTitle