function InaccessibleMenuLink::__construct

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Menu/InaccessibleMenuLink.php \Drupal\Core\Menu\InaccessibleMenuLink::__construct()
  2. 10 core/lib/Drupal/Core/Menu/InaccessibleMenuLink.php \Drupal\Core\Menu\InaccessibleMenuLink::__construct()
  3. 11.x core/lib/Drupal/Core/Menu/InaccessibleMenuLink.php \Drupal\Core\Menu\InaccessibleMenuLink::__construct()

Constructs a new InaccessibleMenuLink.

Parameters

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

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.