You are here

public function UserDashboardSectionStorage::buildRoutes in Dashboards with Layout Builder 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/SectionStorage/UserDashboardSectionStorage.php \Drupal\dashboards\Plugin\SectionStorage\UserDashboardSectionStorage::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 DashboardSectionStorage::buildRoutes

See also

\Drupal\Core\Routing\RoutingEvents::ALTER

File

src/Plugin/SectionStorage/UserDashboardSectionStorage.php, line 75

Class

UserDashboardSectionStorage
Class DashboardSectionStorage.

Namespace

Drupal\dashboards\Plugin\SectionStorage

Code

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