class RouteSubscriber in Paragraphs frontend ui 8.2
Class RouteSubscriber.
Listens to the dynamic route events.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\paragraphs_frontend_ui\Routing\RouteSubscriber
Expanded class hierarchy of RouteSubscriber
1 string reference to 'RouteSubscriber'
1 service uses RouteSubscriber
File
- src/
Routing/ RouteSubscriber.php, line 14
Namespace
Drupal\paragraphs_frontend_ui\RoutingView source
class RouteSubscriber extends RouteSubscriberBase {
/**
* {@inheritdoc}
*/
protected function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('paragraphs_edit.edit_form')) {
$config = \Drupal::config(SettingsForm::SETTINGS_NAME);
$route
->addDefaults([
'_entity_form' => $config
->get('pfui_edit_content_form_mode'),
]);
$route
->addRequirements([
'_custom_access' => '\\Drupal\\paragraphs_frontend_ui\\Controller\\ParagraphsFrontendUIController::accessEditContent',
]);
}
if ($route = $collection
->get('paragraphs_edit.delete_form')) {
$route
->addRequirements([
'_custom_access' => '\\Drupal\\paragraphs_frontend_ui\\Controller\\ParagraphsFrontendUIController::accessLibraryItem',
]);
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RouteSubscriber:: |
protected | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |