TestContextualLink.php in Drupal 10
File
core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.phpView source
<?php
namespace Drupal\menu_test\Plugin\Menu\ContextualLink;
use Drupal\Core\Menu\ContextualLinkDefault;
use Symfony\Component\HttpFoundation\Request;
/**
* Defines a contextual link plugin with a dynamic title from user input.
*/
class TestContextualLink extends ContextualLinkDefault {
/**
* {@inheritdoc}
*/
public function getTitle(Request $request = NULL) {
return "<script>alert('Welcome to the jungle!')</script>";
}
}
Classes
Name | Description |
---|---|
TestContextualLink | Defines a contextual link plugin with a dynamic title from user input. |