function Router::generate

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

File

core/lib/Drupal/Core/Routing/Router.php, line 334

Class

Router
Router implementation in Drupal.

Namespace

Drupal\Core\Routing

Code

public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH) : string {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:8.3.0 and will throw an exception from drupal:10.0.0. Use the \\Drupal\\Core\\Url object instead. See https://www.drupal.org/node/2820197', E_USER_DEPRECATED);
    return $this->urlGenerator
        ->generate($name, $parameters, $referenceType);
}

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