public DefaultHtmlRouteProvider::getRoutes(EntityTypeInterface $entity_type)
Provides routes for entities.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type
Return value
\Symfony\Component\Routing\RouteCollection|\Symfony\Component\Routing\Route[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.
Overrides EntityRouteProviderInterface::getRoutes
File
- core/lib/Drupal/Core/Entity/Routing/DefaultHtmlRouteProvider.php, line 74
Class
- DefaultHtmlRouteProvider
- Provides HTML routes for entities.
Namespace
Drupal\Core\Entity\Routing
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | public function getRoutes(EntityTypeInterface $entity_type ) { $collection = new RouteCollection(); $entity_type_id = $entity_type ->id(); if ( $add_page_route = $this ->getAddPageRoute( $entity_type )) { $collection ->add( "entity.{$entity_type_id}.add_page" , $add_page_route ); } if ( $add_form_route = $this ->getAddFormRoute( $entity_type )) { $collection ->add( "entity.{$entity_type_id}.add_form" , $add_form_route ); } if ( $canonical_route = $this ->getCanonicalRoute( $entity_type )) { $collection ->add( "entity.{$entity_type_id}.canonical" , $canonical_route ); } if ( $edit_route = $this ->getEditFormRoute( $entity_type )) { $collection ->add( "entity.{$entity_type_id}.edit_form" , $edit_route ); } if ( $delete_route = $this ->getDeleteFormRoute( $entity_type )) { $collection ->add( "entity.{$entity_type_id}.delete_form" , $delete_route ); } if ( $collection_route = $this ->getCollectionRoute( $entity_type )) { $collection ->add( "entity.{$entity_type_id}.collection" , $collection_route ); } return $collection ; } |
Please login to continue.