class FileRouteProvider
Same name in other branches
- 11.x core/modules/file/src/Entity/FileRouteProvider.php \Drupal\file\Entity\FileRouteProvider
Provides routes for files.
Hierarchy
- class \Drupal\file\Entity\FileRouteProvider implements \Drupal\Core\Entity\Routing\EntityRouteProviderInterface
Expanded class hierarchy of FileRouteProvider
File
-
core/
modules/ file/ src/ Entity/ FileRouteProvider.php, line 13
Namespace
Drupal\file\EntityView source
class FileRouteProvider implements EntityRouteProviderInterface {
/**
* {@inheritdoc}
*/
public function getRoutes(EntityTypeInterface $entity_type) {
$route_collection = new RouteCollection();
$route = (new Route('/file/{file}/delete'))->addDefaults([
'_entity_form' => 'file.delete',
'_title' => 'Delete',
])
->setRequirement('file', '\\d+')
->setRequirement('_entity_access', 'file.delete')
->setOption('_admin_route', TRUE);
$route_collection->add('entity.file.delete_form', $route);
return $route_collection;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
FileRouteProvider::getRoutes | public | function | Provides routes for entities. | Overrides EntityRouteProviderInterface::getRoutes |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.