function PageDisplayVariantSelectionEvent::__construct

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

Constructs the page display variant plugin selection event.

Parameters

string $plugin_id: The ID of the page display variant plugin to use by default.

\Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match, for context.

File

core/lib/Drupal/Core/Render/PageDisplayVariantSelectionEvent.php, line 62

Class

PageDisplayVariantSelectionEvent
Event fired when rendering main content, to select a page display variant.

Namespace

Drupal\Core\Render

Code

public function __construct($plugin_id, RouteMatchInterface $route_match) {
    $this->pluginId = $plugin_id;
    $this->routeMatch = $route_match;
}

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