You are here

public function AccessAwareRouter::generate in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::generate()

File

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

Class

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

Namespace

Drupal\Core\Routing

Code

public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH) {
  if ($this->router instanceof UrlGeneratorInterface) {
    return $this->router
      ->generate($name, $parameters, $referenceType);
  }
}