You are here

public function UrlGenerator::generate in Drupal 8

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

File

core/lib/Drupal/Core/Routing/UrlGenerator.php, line 257

Class

UrlGenerator
Generates URLs from route names and parameters.

Namespace

Drupal\Core\Routing

Code

public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH) {
  $options['absolute'] = is_bool($referenceType) ? $referenceType : $referenceType === self::ABSOLUTE_URL;
  return $this
    ->generateFromRoute($name, $parameters, $options);
}