You are here

protected function DeveloperSyncForm::buildUrl in Apigee Edge 8

Build URL for developer-user sync processes, using CSRF protection.

Parameters

string $route_name: The name of the route.

Return value

\Drupal\Core\Url The URL to redirect to.

1 call to DeveloperSyncForm::buildUrl()
DeveloperSyncForm::buildForm in src/Form/DeveloperSyncForm.php
Form constructor.

File

src/Form/DeveloperSyncForm.php, line 149

Class

DeveloperSyncForm
Provides a form to start developer synchronization.

Namespace

Drupal\apigee_edge\Form

Code

protected function buildUrl(string $route_name) : Url {
  $url = Url::fromRoute($route_name);
  $token = \Drupal::csrfToken()
    ->get($url
    ->getInternalPath());
  $url
    ->setOptions([
    'query' => [
      'destination' => 'admin/config/apigee-edge/developer-settings/sync',
      'token' => $token,
    ],
  ]);
  return $url;
}