You are here

class AdminHtmlRouteProvider in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider
  2. 10 core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider

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

Use this class if the add/edit/delete form routes should use the administrative theme.

Hierarchy

Expanded class hierarchy of AdminHtmlRouteProvider

See also

\Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider.

4 files declare their use of AdminHtmlRouteProvider
FeedHtmlRouteProvider.php in core/modules/aggregator/src/FeedHtmlRouteProvider.php
MediaRouteProvider.php in core/modules/media/src/Routing/MediaRouteProvider.php
path.module in core/modules/path/path.module
Enables users to rename URLs.
VocabularyRouteProvider.php in core/modules/taxonomy/src/Entity/Routing/VocabularyRouteProvider.php

File

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

Namespace

Drupal\Core\Entity\Routing
View source
class AdminHtmlRouteProvider extends DefaultHtmlRouteProvider {

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

  /**
   * {@inheritdoc}
   */
  protected function getAddFormRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::getAddFormRoute($entity_type)) {
      $route
        ->setOption('_admin_route', TRUE);
      return $route;
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function getEditFormRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::getEditFormRoute($entity_type)) {
      $route
        ->setOption('_admin_route', TRUE);
      return $route;
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function getDeleteFormRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::getDeleteFormRoute($entity_type)) {
      $route
        ->setOption('_admin_route', TRUE);
      return $route;
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function getDeleteMultipleFormRoute(EntityTypeInterface $entity_type) {
    if ($route = parent::getDeleteMultipleFormRoute($entity_type)) {
      $route
        ->setOption('_admin_route', TRUE);
      return $route;
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AdminHtmlRouteProvider::getAddFormRoute protected function Gets the add-form route. Overrides DefaultHtmlRouteProvider::getAddFormRoute
AdminHtmlRouteProvider::getAddPageRoute protected function Gets the add page route. Overrides DefaultHtmlRouteProvider::getAddPageRoute
AdminHtmlRouteProvider::getDeleteFormRoute protected function Gets the delete-form route. Overrides DefaultHtmlRouteProvider::getDeleteFormRoute
AdminHtmlRouteProvider::getDeleteMultipleFormRoute protected function Returns the delete multiple form route. Overrides DefaultHtmlRouteProvider::getDeleteMultipleFormRoute
AdminHtmlRouteProvider::getEditFormRoute protected function Gets the edit-form route. Overrides DefaultHtmlRouteProvider::getEditFormRoute 1
DefaultHtmlRouteProvider::$entityFieldManager protected property The entity field manager.
DefaultHtmlRouteProvider::$entityTypeManager protected property The entity type manager.
DefaultHtmlRouteProvider::createInstance public static function Instantiates a new instance of this entity handler. Overrides EntityHandlerInterface::createInstance 1
DefaultHtmlRouteProvider::getCanonicalRoute protected function Gets the canonical route. 3
DefaultHtmlRouteProvider::getCollectionRoute protected function Gets the collection route. 2
DefaultHtmlRouteProvider::getEntityTypeIdKeyType protected function Gets the type of the ID key for a given entity type. 1
DefaultHtmlRouteProvider::getRoutes public function Provides routes for entities. Overrides EntityRouteProviderInterface::getRoutes 1
DefaultHtmlRouteProvider::__construct public function Constructs a new DefaultHtmlRouteProvider. 1