public function ParagraphBlocksRouteSubscriber::alterRoutes in Paragraph blocks 8
Same name and namespace in other branches
- 8.2 src/Routing/ParagraphBlocksRouteSubscriber.php \Drupal\paragraph_blocks\Routing\ParagraphBlocksRouteSubscriber::alterRoutes()
- 3.x src/Routing/ParagraphBlocksRouteSubscriber.php \Drupal\paragraph_blocks\Routing\ParagraphBlocksRouteSubscriber::alterRoutes()
Alters existing routes for a specific collection.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.
Overrides RouteSubscriberBase::alterRoutes
File
- src/
Routing/ ParagraphBlocksRouteSubscriber.php, line 16
Class
- ParagraphBlocksRouteSubscriber
- Listen to route events to override panels.select_block controller.
Namespace
Drupal\paragraph_blocks\RoutingCode
public function alterRoutes(RouteCollection $collection) {
$route = $collection
->get('panels.select_block');
if ($route) {
$route
->setDefaults([
'_controller' => '\\Drupal\\paragraph_blocks\\Controller\\ParagraphBlocksPanelsController::selectBlock',
]);
}
}