You are here

public function MenuPositionLink::__construct in Menu Position 8

Same name in this branch
  1. 8 src/Plugin/Derivative/MenuPositionLink.php \Drupal\menu_position\Plugin\Derivative\MenuPositionLink::__construct()
  2. 8 src/Plugin/Menu/MenuPositionLink.php \Drupal\menu_position\Plugin\Menu\MenuPositionLink::__construct()

Constructs a Drupal\Component\Plugin\PluginBase object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory service.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match service.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

\Drupal\Core\Routing\AdminContext $admin_context: The admin context.

\Drupal\Core\Controller\TitleResolverInterface $title_resolver: The title resolver service.

\Drupal\Core\Render\RendererInterface $renderer: The renderer service.

Overrides PluginBase::__construct

File

src/Plugin/Menu/MenuPositionLink.php, line 96

Class

MenuPositionLink
Defines menu links provided by menu position rules.

Namespace

Drupal\menu_position\Plugin\Menu

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityTypeManagerInterface $entity_type_manager, ConfigFactoryInterface $config_factory, RouteMatchInterface $route_match, RequestStack $request_stack, AdminContext $admin_context, TitleResolverInterface $title_resolver, RendererInterface $renderer) {
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->entityTypeManager = $entity_type_manager;
  $this->settings = $config_factory
    ->get('menu_position.settings');
  $this->routeMatch = $route_match;
  $this->requestStack = $request_stack;
  $this->adminContext = $admin_context;
  $this->titleResolver = $title_resolver;
  $this->renderer = $renderer;
}