You are here

public function LinkCheckerLinkRouteProvider::getRoutes in Link checker 8

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

src/LinkCheckerLinkRouteProvider.php, line 18

Class

LinkCheckerLinkRouteProvider
Provides routes for linkchecker link.

Namespace

Drupal\linkchecker

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $route_collection = new RouteCollection();
  $route = (new Route('/admin/config/content/linkcheckerlink/{linkcheckerlink}/edit'))
    ->setDefault('_entity_form', 'linkcheckerlink.edit')
    ->setRequirement('_entity_access', 'linkcheckerlink.update')
    ->setRequirement('linkcheckerlink', '\\d+');
  $route_collection
    ->add('entity.linkcheckerlink.edit_form', $route);
  return $route_collection;
}