function 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 354

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.