function AccessAwareRouter::getContext

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::getContext()
  2. 10 core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::getContext()
  3. 11.x core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::getContext()

File

core/lib/Drupal/Core/Routing/AccessAwareRouter.php, line 80

Class

AccessAwareRouter
A router class for Drupal with access check and upcasting.

Namespace

Drupal\Core\Routing

Code

public function getContext() {
    if ($this->router instanceof RequestContextAwareInterface) {
        return $this->router
            ->getContext();
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.