You are here

public function DashboardSectionStorage::buildRoutes in Dashboards with Layout Builder 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/SectionStorage/DashboardSectionStorage.php \Drupal\dashboards\Plugin\SectionStorage\DashboardSectionStorage::buildRoutes()

Provides the routes needed for Layout Builder UI.

Allows the plugin to add or alter routes during the route building process. \Drupal\layout_builder\Routing\LayoutBuilderRoutesTrait is provided for the typical use case of building a standard Layout Builder UI.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection.

Overrides SectionStorageInterface::buildRoutes

See also

\Drupal\Core\Routing\RoutingEvents::ALTER

1 method overrides DashboardSectionStorage::buildRoutes()
UserDashboardSectionStorage::buildRoutes in src/Plugin/SectionStorage/UserDashboardSectionStorage.php
Provides the routes needed for Layout Builder UI.

File

src/Plugin/SectionStorage/DashboardSectionStorage.php, line 170

Class

DashboardSectionStorage
Dashboard section storage.

Namespace

Drupal\dashboards\Plugin\SectionStorage

Code

public function buildRoutes(RouteCollection $collection) {
  $requirements = [];
  $this
    ->buildLayoutRoutes($collection, $this
    ->getPluginDefinition(), 'dashboards/{dashboard}/layout', [
    'parameters' => [
      'dashboard' => [
        'type' => 'entity:dashboard',
      ],
    ],
  ], $requirements, [
    '_admin_route' => FALSE,
  ], '', 'dashboard');
}