You are here

protected function GroupRouteProvider::getAddFormRoute in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Entity/Routing/GroupRouteProvider.php \Drupal\group\Entity\Routing\GroupRouteProvider::getAddFormRoute()

Gets the add-form route.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides DefaultHtmlRouteProvider::getAddFormRoute

File

src/Entity/Routing/GroupRouteProvider.php, line 26

Class

GroupRouteProvider
Provides routes for groups.

Namespace

Drupal\group\Entity\Routing

Code

protected function getAddFormRoute(EntityTypeInterface $entity_type) {
  if ($route = parent::getAddFormRoute($entity_type)) {
    $route
      ->setOption('_group_operation_route', TRUE);
    $route
      ->setDefault('_controller', '\\Drupal\\group\\Entity\\Controller\\GroupController::addForm');
    $route
      ->setDefault('_title_callback', '\\Drupal\\group\\Entity\\Controller\\GroupController::addFormTitle');
    return $route;
  }
}