abstract class PathListenerBase

Base class for listeners that are manipulating the path.

Hierarchy

Expanded class hierarchy of PathListenerBase

File

drupal/core/lib/Drupal/Core/EventSubscriber/PathListenerBase.php, line 15
Definition of Drupal\Core\EventSubscriber\PathListenerBase.

Namespace

Drupal\Core\EventSubscriber
View source
abstract class PathListenerBase {
  public function extractPath(Request $request) {
    $path = $request->attributes
      ->get('system_path');
    return isset($path) ? $path : trim($request
      ->getPathInfo(), '/');
  }
  public function setPath(Request $request, $path) {
    $request->attributes
      ->set('system_path', $path);
  }

}

Members