protected function GroupContentMenuRouteProvider::getAddPageRoute in Group Content Menu 8
Gets the add page route.
Built only for entity types that have bundles.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.
Return value
\Symfony\Component\Routing\Route|null The generated route, if available.
Overrides DefaultHtmlRouteProvider::getAddPageRoute
File
- src/
Routing/ GroupContentMenuRouteProvider.php, line 90
Class
- GroupContentMenuRouteProvider
- Provides routes for group_content_menu content.
Namespace
Drupal\group_content_menu\RoutingCode
protected function getAddPageRoute(EntityTypeInterface $entity_type) {
if ($route = parent::getAddPageRoute($entity_type)) {
return $route
->setDefaults([
'_title' => 'Add new menu',
'_controller' => sprintf('%s::addPage', GroupContentMenuController::class),
])
->setRequirement('_group_permission', 'manage group_content_menu')
->setRequirement('_group_installed_content', implode('+', $this
->getPluginIds()))
->setOption('_group_operation_route', TRUE);
}
}