You are here

public function RequestContext::fromRequest in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Routing/RequestContext.php \Drupal\Core\Routing\RequestContext::fromRequest()
1 call to RequestContext::fromRequest()
RequestContext::fromRequestStack in core/lib/Drupal/Core/Routing/RequestContext.php
Populates the context from the current request from the request stack.

File

core/lib/Drupal/Core/Routing/RequestContext.php, line 37

Class

RequestContext
Holds information about the current request.

Namespace

Drupal\Core\Routing

Code

public function fromRequest(Request $request) {
  parent::fromRequest($request);

  // @todo Extract the code in DrupalKernel::initializeRequestGlobals.
  //   See https://www.drupal.org/node/2404601
  if (isset($GLOBALS['base_url'])) {
    $this
      ->setCompleteBaseUrl($GLOBALS['base_url']);
  }
}