You are here

protected function FeedbackMessageHtmlRouteProvider::getAddPageRoute in Feedback 3.x

Gets the add page route.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides AdminHtmlRouteProvider::getAddPageRoute

1 call to FeedbackMessageHtmlRouteProvider::getAddPageRoute()
FeedbackMessageHtmlRouteProvider::getRoutes in src/FeedbackMessageHtmlRouteProvider.php
Provides routes for entities.

File

src/FeedbackMessageHtmlRouteProvider.php, line 112

Class

FeedbackMessageHtmlRouteProvider
Provides routes for Feedback message entities.

Namespace

Drupal\feedback

Code

protected function getAddPageRoute(EntityTypeInterface $entity_type) {
  $route = new Route("/admin/structure/{$entity_type->id()}/add");
  $route
    ->setDefaults([
    '_controller' => 'Drupal\\feedback\\Controller\\FeedbackMessageAddController::add',
    '_title' => "Add {$entity_type->getLabel()}",
  ])
    ->setRequirement('_entity_create_access', $entity_type
    ->id())
    ->setOption('_admin_route', TRUE);
  return $route;
}