class ContextualLinkDefault

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/ContextualLinkDefault.php \Drupal\Core\Menu\ContextualLinkDefault
  2. 8.9.x core/lib/Drupal/Core/Menu/ContextualLinkDefault.php \Drupal\Core\Menu\ContextualLinkDefault
  3. 10 core/lib/Drupal/Core/Menu/ContextualLinkDefault.php \Drupal\Core\Menu\ContextualLinkDefault

Provides a common base implementation of a contextual link.

Hierarchy

Expanded class hierarchy of ContextualLinkDefault

4 files declare their use of ContextualLinkDefault
ConfigTranslationContextualLink.php in core/modules/config_translation/src/Plugin/Menu/ContextualLink/ConfigTranslationContextualLink.php
ContextualLinkDefaultTest.php in core/tests/Drupal/Tests/Core/Menu/ContextualLinkDefaultTest.php
ContextualLinkManagerTest.php in core/tests/Drupal/Tests/Core/Menu/ContextualLinkManagerTest.php
TestContextualLink.php in core/modules/system/tests/modules/menu_test/src/Plugin/Menu/ContextualLink/TestContextualLink.php

File

core/lib/Drupal/Core/Menu/ContextualLinkDefault.php, line 11

Namespace

Drupal\Core\Menu
View source
class ContextualLinkDefault extends PluginBase implements ContextualLinkInterface {
    
    /**
     * {@inheritdoc}
     */
    public function getTitle(?Request $request = NULL) {
        // The title from YAML file discovery may be a TranslatableMarkup object.
        return (string) $this->pluginDefinition['title'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getRouteName() {
        return $this->pluginDefinition['route_name'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getGroup() {
        return $this->pluginDefinition['group'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getOptions() {
        return $this->pluginDefinition['options'];
    }
    
    /**
     * {@inheritdoc}
     */
    public function getWeight() {
        return $this->pluginDefinition['weight'];
    }

}

Members

Title Sort descending Deprecated Modifiers Object type Summary Overriden Title Overrides
ContextualLinkDefault::getGroup public function Overrides ContextualLinkInterface::getGroup
ContextualLinkDefault::getOptions public function Overrides ContextualLinkInterface::getOptions
ContextualLinkDefault::getRouteName public function Overrides ContextualLinkInterface::getRouteName
ContextualLinkDefault::getTitle public function Overrides ContextualLinkInterface::getTitle 2
ContextualLinkDefault::getWeight public function Overrides ContextualLinkInterface::getWeight
PluginBase::$configuration protected property Configuration information passed into the plugin.
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 Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Overrides PluginInspectionInterface::getPluginDefinition
PluginBase::getPluginId public function Overrides PluginInspectionInterface::getPluginId
PluginBase::isConfigurable Deprecated public function Determines if the plugin is configurable.
PluginBase::__construct public function Constructs a \Drupal\Component\Plugin\PluginBase object. 6

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.