MenuLinkManager::processDefinition

protected MenuLinkManager::processDefinition(array &$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, the logic can be added by replacing or extending this method.

Parameters

array $definition: The definition to be processed and modified by reference.

$plugin_id: The ID of the plugin this definition is being used for.

File

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

Class

MenuLinkManager
Manages discovery, instantiation, and tree building of menu link plugins.

Namespace

Drupal\Core\Menu

Code

protected function processDefinition(array &$definition, $plugin_id) {
  $definition = NestedArray::mergeDeep($this->defaults, $definition);
  // Typecast so NULL, no parent, will be an empty string since the parent ID
  // should be a string.
  $definition['parent'] = (string) $definition['parent'];
  $definition['id'] = $plugin_id;
}
doc_Drupal
2016-10-29 09:27:07
Comments
Leave a Comment

Please login to continue.