MenuLinkManager::createInstance

public MenuLinkManager::createInstance($plugin_id, array $configuration = array())

Returns a pre-configured menu link plugin instance.

Parameters

string $plugin_id: The ID of the plugin being instantiated.

array $configuration: An array of configuration relevant to the plugin instance.

Return value

\Drupal\Core\Menu\MenuLinkInterface A menu link instance.

Throws

\Drupal\Component\Plugin\Exception\PluginException If the instance cannot be created, such as if the ID is invalid.

Overrides FactoryInterface::createInstance

File

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

Class

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

Namespace

Drupal\Core\Menu

Code

public function createInstance($plugin_id, array $configuration = array()) {
  return $this->getFactory()->createInstance($plugin_id, $configuration);
}
doc_Drupal
2016-10-29 09:27:04
Comments
Leave a Comment

Please login to continue.