function Router::generate

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

This method is intentionally not implemented.

Use Drupal\Core\Url instead.

Throws

\BadMethodCallException

See also

https://www.drupal.org/node/2820197

File

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

Class

Router
Router implementation in Drupal.

Namespace

Drupal\Core\Routing

Code

public function generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH) : string {
    throw new \BadMethodCallException(__METHOD__ . '() is not supported. Use the \\Drupal\\Core\\Url object instead. See https://www.drupal.org/node/2820197');
}

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