You are here

protected function UltimenuController::getCurrentPath in Ultimenu 8.2

Gets the current page path.

Return value

string The current page path.

1 call to UltimenuController::getCurrentPath()
UltimenuController::load in src/Controller/UltimenuController.php
Loads and renders a region via AJAX.

File

src/Controller/UltimenuController.php, line 182

Class

UltimenuController
Provides controller for Ultimenu region route.

Namespace

Drupal\ultimenu\Controller

Code

protected function getCurrentPath(Request $request) {
  if (!isset($this->currentPath)) {
    $referer = $request->headers
      ->get('Referer', '');
    $url = parse_url($referer);
    $this->currentPath = $url['path'] == '/' ? $this
      ->getFrontPagePath() : $url['path'];
  }
  return $this->currentPath;
}