public MenuLinkManagerInterface::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.
string $id: The plugin ID for the new menu link definition that is being added.
array $definition: The values of the link definition.
\Drupal\Core\Menu\MenuLinkInterface A plugin instance created using the newly added definition.
\Drupal\Component\Plugin\Exception\PluginException Thrown when the $id is not valid or is an already existing plugin ID.
public function addDefinition($id, array $definition);
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!MenuLinkManagerInterface.php/function/MenuLinkManagerInterface::addDefinition/8.1.x