You are here

public function TrustedHostsTestController::fakeRequestHost in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/trusted_hosts_test/src/Controller/TrustedHostsTestController.php \Drupal\trusted_hosts_test\Controller\TrustedHostsTestController::fakeRequestHost()

Creates a fake request and prints out its host.

1 string reference to 'TrustedHostsTestController::fakeRequestHost'
trusted_hosts_test.routing.yml in core/modules/system/tests/modules/trusted_hosts_test/trusted_hosts_test.routing.yml
core/modules/system/tests/modules/trusted_hosts_test/trusted_hosts_test.routing.yml

File

core/modules/system/tests/modules/trusted_hosts_test/src/Controller/TrustedHostsTestController.php, line 19
Contains \Drupal\trusted_hosts_test\Controller\TrustedHostsTestController.

Class

TrustedHostsTestController
Provides a test controller for testing the trusted hosts setting.

Namespace

Drupal\trusted_hosts_test\Controller

Code

public function fakeRequestHost() {
  $request = Request::create('/');
  return [
    '#markup' => 'Host: ' . $request
      ->getHost(),
  ];
}