public function PathSubscriber::onKernelRequestFrontPageResolve

Resolve the front-page default path.

@todo The path system should be objectified to remove the function calls in this method.

Parameters

Symfony\Component\HttpKernel\Event\GetResponseEvent $event: The Event to process.

File

drupal/core/lib/Drupal/Core/EventSubscriber/PathSubscriber.php, line 57
Definition of Drupal\Core\EventSubscriber\PathSubscriber.

Class

PathSubscriber
Access subscriber for controller requests.

Namespace

Drupal\Core\EventSubscriber

Code

public function onKernelRequestFrontPageResolve(GetResponseEvent $event) {
  $request = $event
    ->getRequest();
  $path = $this
    ->extractPath($request);
  if (empty($path)) {

    // @todo Temporary hack. Fix when configuration is injectable.
    $path = config('system.site')
      ->get('page.front');
    if (empty($path)) {
      $path = 'user';
    }
  }
  $this
    ->setPath($request, $path);
}