W3cubDocs

/Drupal 8

public function InaccessibleMenuLink::__construct

public InaccessibleMenuLink::__construct(MenuLinkInterface $wrapped_link)

Constructs a new InaccessibleMenuLink.

Parameters

\Drupal\Core\Menu\MenuLinkInterface $wrapped_link: The menu link to wrap.

Overrides PluginBase::__construct

File

core/lib/Drupal/Core/Menu/InaccessibleMenuLink.php, line 27

Class

InaccessibleMenuLink
A menu link plugin for wrapping another menu link, in sensitive situations.

Namespace

Drupal\Core\Menu

Code

public function __construct(MenuLinkInterface $wrapped_link) {
  $this->wrappedLink = $wrapped_link;
  $plugin_definition = [
    'route_name' => '<front>',
    'route_parameters' => [],
    'url' => NULL,
  ] + $this->wrappedLink->getPluginDefinition();
  parent::__construct([], $this->wrappedLink->getPluginId(), $plugin_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!InaccessibleMenuLink.php/function/InaccessibleMenuLink::__construct/8.1.x