protected function OrgHtmlRouteProvider::getAddPageRoute in RedHen CRM 8
Gets the add page route.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.
Return value
\Symfony\Component\Routing\Route|null The generated route, if available.
Overrides AdminHtmlRouteProvider::getAddPageRoute
1 call to OrgHtmlRouteProvider::getAddPageRoute()
- OrgHtmlRouteProvider::getRoutes in modules/
redhen_org/ src/ OrgHtmlRouteProvider.php - Provides routes for entities.
File
- modules/
redhen_org/ src/ OrgHtmlRouteProvider.php, line 111
Class
- OrgHtmlRouteProvider
- Provides routes for Org entities.
Namespace
Drupal\redhen_orgCode
protected function getAddPageRoute(EntityTypeInterface $entity_type) {
$route = new Route("/admin/structure/{$entity_type->id()}/add");
$route
->setDefaults([
'_controller' => 'Drupal\\redhen_org\\Controller\\OrgAddController::add',
'_title' => "Add {$entity_type->getLabel()}",
])
->setRequirement('_entity_create_access', $entity_type
->id())
->setOption('_admin_route', TRUE);
return $route;
}