You are here

public function PageManagerSectionStorage::buildRoutes in Page Manager 8.4

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

File

src/Plugin/SectionStorage/PageManagerSectionStorage.php, line 150

Class

PageManagerSectionStorage
Defines the 'page_manager' section storage type.

Namespace

Drupal\page_manager\Plugin\SectionStorage

Code

public function buildRoutes(RouteCollection $collection) {
  $path = '/admin/structure/page_manager/{page_variant}/layout';
  $options['parameters']['page_variant']['type'] = 'entity:page_variant';
  $options['_admin_route'] = FALSE;
  $this
    ->buildLayoutRoutes($collection, $this
    ->getPluginDefinition(), $path, [], [], $options, '', 'page_variant');
}