class AdminHtmlRouteProvider in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/Routing/AdminHtmlRouteProvider.php \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider
- 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
- class \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider implements EntityHandlerInterface, EntityRouteProviderInterface
- class \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider
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\RoutingView 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;
}
}
}