function AdminHtmlRouteProvider::getAddPageRoute

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider::getAddPageRoute()
  2. 8.9.x core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider::getAddPageRoute()
  3. 10 core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider::getAddPageRoute()

Overrides DefaultHtmlRouteProvider::getAddPageRoute

File

core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php, line 20

Class

AdminHtmlRouteProvider
Provides HTML routes for entities with administrative add/edit/delete pages.

Namespace

Drupal\Core\Entity\Routing

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.