function ContextualLinkManager::processDefinition

Same name in other branches
  1. 9 core/lib/Drupal/Core/Menu/ContextualLinkManager.php \Drupal\Core\Menu\ContextualLinkManager::processDefinition()
  2. 10 core/lib/Drupal/Core/Menu/ContextualLinkManager.php \Drupal\Core\Menu\ContextualLinkManager::processDefinition()
  3. 11.x core/lib/Drupal/Core/Menu/ContextualLinkManager.php \Drupal\Core\Menu\ContextualLinkManager::processDefinition()

Overrides DefaultPluginManager::processDefinition

File

core/lib/Drupal/Core/Menu/ContextualLinkManager.php, line 126

Class

ContextualLinkManager
Defines a contextual link plugin manager to deal with contextual links.

Namespace

Drupal\Core\Menu

Code

public function processDefinition(&$definition, $plugin_id) {
    parent::processDefinition($definition, $plugin_id);
    // If there is no route name, this is a broken definition.
    if (empty($definition['route_name'])) {
        throw new PluginException(sprintf('Contextual link plugin (%s) definition must include "route_name".', $plugin_id));
    }
    // If there is no group name, this is a broken definition.
    if (empty($definition['group'])) {
        throw new PluginException(sprintf('Contextual link plugin (%s) definition must include "group".', $plugin_id));
    }
}

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