class AdminHtmlRouteProvider
Same name in other branches
- 9 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
- 11.x 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 \Drupal\Core\Entity\Routing\EntityRouteProviderInterface, \Drupal\Core\Entity\EntityHandlerInterface
- class \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider extends \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider
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;
}
}
}
Members
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.