ContextualLinkDefault.php 966 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. namespace Drupal\Core\Menu;
  3. use Drupal\Component\Plugin\PluginBase;
  4. use Symfony\Component\HttpFoundation\Request;
  5. /**
  6. * Provides a common base implementation of a contextual link.
  7. */
  8. class ContextualLinkDefault extends PluginBase implements ContextualLinkInterface {
  9. /**
  10. * {@inheritdoc}
  11. */
  12. public function getTitle(Request $request = NULL) {
  13. // The title from YAML file discovery may be a TranslatableMarkup object.
  14. return (string) $this->pluginDefinition['title'];
  15. }
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function getRouteName() {
  20. return $this->pluginDefinition['route_name'];
  21. }
  22. /**
  23. * {@inheritdoc}
  24. */
  25. public function getGroup() {
  26. return $this->pluginDefinition['group'];
  27. }
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function getOptions() {
  32. return $this->pluginDefinition['options'];
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function getWeight() {
  38. return $this->pluginDefinition['weight'];
  39. }
  40. }