You are here

protected function AdminCreateHtmlRouteProvider::addPageRoute in Entity API 8.0

Returns the add page route.

Built only for entity types that have bundles.

Parameters

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

Return value

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

Overrides CreateHtmlRouteProvider::addPageRoute

File

src/Routing/AdminCreateHtmlRouteProvider.php, line 20
Contains \Drupal\entity\Routing\AdminCreateHtmlRouteProvider.

Class

AdminCreateHtmlRouteProvider
Provides HTML routes for creating entities using the administrative theme.

Namespace

Drupal\entity\Routing

Code

protected function addPageRoute(EntityTypeInterface $entity_type) {
  if ($route = parent::addPageRoute($entity_type)) {
    $route
      ->setOption('_admin_route', TRUE);
    return $route;
  }
}