function OpenModalDialogWithUrl::getBaseUrl

Same name and namespace in other branches
  1. 10 core/lib/Drupal/Core/Ajax/OpenModalDialogWithUrl.php \Drupal\Core\Ajax\OpenModalDialogWithUrl::getBaseUrl()

Gets the complete base URL.

1 call to OpenModalDialogWithUrl::getBaseUrl()
OpenModalDialogWithUrl::render in core/lib/Drupal/Core/Ajax/OpenModalDialogWithUrl.php
Return an array to be run through json_encode and sent to the client.

File

core/lib/Drupal/Core/Ajax/OpenModalDialogWithUrl.php, line 52

Class

OpenModalDialogWithUrl
Provides an AJAX command for opening a modal with URL.

Namespace

Drupal\Core\Ajax

Code

private function getBaseUrl() {
    $requestContext = \Drupal::service('router.request_context');
    return $requestContext->getCompleteBaseUrl();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.