ContextualLinkManager::processDefinition

public ContextualLinkManager::processDefinition(&$definition, $plugin_id)

Performs extra processing on plugin definitions.

By default we add defaults for the type to the definition. If a type has additional processing logic they can do that by replacing or extending the method.

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

1
2
3
4
5
6
7
8
9
10
11
12
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));
  }
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.