RequestContext::fromRequest

public RequestContext::fromRequest(Request $request)

Updates the RequestContext information based on a HttpFoundation Request.

Parameters

Request $request A Request instance:

Return value

RequestContext The current instance, implementing a fluent interface

Overrides RequestContext::fromRequest

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']);
  }
}
doc_Drupal
2016-10-29 09:37:46
Comments
Leave a Comment

Please login to continue.