You are here

protected function ConnectionHtmlRouteProvider::generateRoute in RedHen CRM 8

Generates a route based on the provided values.

Parameters

string $canonical: Canonical path of entity type.

string $path: Path for this route.

array $parameters: Parameters for the route.

string $controller: Controller method for the route.

string $title_callback: Title callback for the route.

string $connection_entity_type_id: Connection entity type machine name.

Return value

\Symfony\Component\Routing\Route Drupal route object.

1 call to ConnectionHtmlRouteProvider::generateRoute()
ConnectionHtmlRouteProvider::getAddEntityRoutes in modules/redhen_connection/src/ConnectionHtmlRouteProvider.php
Gets all entity type add connection routes.

File

modules/redhen_connection/src/ConnectionHtmlRouteProvider.php, line 206

Class

ConnectionHtmlRouteProvider
Provides routes for Connection entities.

Namespace

Drupal\redhen_connection

Code

protected function generateRoute($canonical, $path, array $parameters, $controller, $title_callback, $connection_entity_type_id) {
  $route = new Route($canonical . $path);
  $route
    ->setOption('parameters', $parameters);
  $route
    ->setDefaults([
    '_controller' => $controller,
    '_title_callback' => $title_callback,
  ])
    ->setOption('_admin_route', TRUE)
    ->setRequirement('_entity_create_access', $connection_entity_type_id);
  return $route;
}