class AccessSchemeRouteProvider in Workbench Access 8
Defines a route provider for access schemes.
Hierarchy
- class \Drupal\Core\Entity\Routing\DefaultHtmlRouteProvider implements EntityHandlerInterface, EntityRouteProviderInterface
- class \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider
- class \Drupal\workbench_access\Routing\AccessSchemeRouteProvider
- class \Drupal\Core\Entity\Routing\AdminHtmlRouteProvider
Expanded class hierarchy of AccessSchemeRouteProvider
File
- src/
Routing/ AccessSchemeRouteProvider.php, line 13
Namespace
Drupal\workbench_access\RoutingView source
class AccessSchemeRouteProvider extends AdminHtmlRouteProvider {
/**
* {@inheritdoc}
*/
public function getRoutes(EntityTypeInterface $entity_type) {
$routes = parent::getRoutes($entity_type);
if ($entity_type
->hasLinkTemplate('sections')) {
$route = new Route($entity_type
->getLinkTemplate('sections'));
$route
->setDefault('_controller', WorkbenchAccessSections::class . '::page');
$route
->setDefault('_title', 'Sections');
$route
->setRequirement('_permission', 'assign workbench access');
$route
->setOption('parameters', [
'access_scheme' => [
'type' => 'entity:access_scheme',
],
]);
$routes
->add('entity.access_scheme.sections', $route);
}
return $routes;
}
}