You are here

protected function DefaultsSectionStorage::getRouteParameters in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage::getRouteParameters()
  2. 10 core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage::getRouteParameters()

Provides the route parameters needed to generate a URL for this object.

Return value

mixed[] An associative array of parameter names and values.

2 calls to DefaultsSectionStorage::getRouteParameters()
DefaultsSectionStorage::getLayoutBuilderUrl in core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php
Gets the URL used to display the Layout Builder UI.
DefaultsSectionStorage::getRedirectUrl in core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php
Gets the URL used when redirecting away from the Layout Builder UI.

File

core/modules/layout_builder/src/Plugin/SectionStorage/DefaultsSectionStorage.php, line 136

Class

DefaultsSectionStorage
Defines the 'defaults' section storage type.

Namespace

Drupal\layout_builder\Plugin\SectionStorage

Code

protected function getRouteParameters() {
  $display = $this
    ->getDisplay();
  $entity_type = $this->entityTypeManager
    ->getDefinition($display
    ->getTargetEntityTypeId());
  $route_parameters = FieldUI::getRouteBundleParameter($entity_type, $display
    ->getTargetBundle());
  $route_parameters['view_mode_name'] = $display
    ->getMode();
  return $route_parameters;
}