class LibraryItemRouteProvider in Paragraphs 8
Contains routes for library item functionality.
Hierarchy
- class \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider implements EntityHandlerInterface, EntityRouteProviderInterface
- class \Drupal\paragraphs_library\Routing\LibraryItemRouteProvider
Expanded class hierarchy of LibraryItemRouteProvider
File
- modules/
paragraphs_library/ src/ Routing/ LibraryItemRouteProvider.php, line 11
Namespace
Drupal\paragraphs_library\RoutingView source
class LibraryItemRouteProvider extends DefaultHtmlRouteProvider {
/**
* {@inheritdoc}
*/
public function getRoutes(EntityTypeInterface $entity_type) {
$route_collection = parent::getRoutes($entity_type);
if ($canonical_route = $route_collection
->get("entity.{$entity_type->id()}.canonical")) {
// Display library items using default theme.
$canonical_route
->setOption('_admin_route', FALSE);
// Restrict access based on permission.
$canonical_route
->addRequirements([
'_permission' => 'administer paragraphs library+create paragraph library item+edit paragraph library item',
]);
}
return $route_collection;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DefaultHtmlRouteProvider:: |
protected | property | The entity field manager. | |
DefaultHtmlRouteProvider:: |
protected | property | The entity type manager. | |
DefaultHtmlRouteProvider:: |
public static | function |
Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface:: |
1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the add-form route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the add page route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the canonical route. | 3 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the collection route. | 2 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the delete-form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Returns the delete multiple form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the edit-form route. | 1 |
DefaultHtmlRouteProvider:: |
protected | function | Gets the type of the ID key for a given entity type. | 1 |
DefaultHtmlRouteProvider:: |
public | function | Constructs a new DefaultHtmlRouteProvider. | 1 |
LibraryItemRouteProvider:: |
public | function |
Provides routes for entities. Overrides DefaultHtmlRouteProvider:: |