MenuLinkManager::addDefinition

public function MenuLinkManager::addDefinition

public MenuLinkManager::addDefinition($id, array $definition)

Adds a new menu link definition to the menu tree storage.

Use this function when you know there is no entry in the tree. This is used for plugins not found through discovery to add new definitions.

Parameters

string $id: The plugin ID for the new menu link definition that is being added.

array $definition: The values of the link definition.

Return value

\Drupal\Core\Menu\MenuLinkInterface A plugin instance created using the new