UrlGeneratorInterface
interface UrlGeneratorInterface implements UrlGeneratorInterface (View source)
Defines an interface for generating a url from a route or system path.
Provides additional methods and options not present in the base interface.
Methods
string
getPathFromRoute(string|Route $name, array $parameters = [])
Gets the internal path (system path) for a route.
string|GeneratedUrl
generateFromRoute(string|Route $name, array $parameters = [], array $options = [], bool $collect_bubbleable_metadata = FALSE)
Generates a URL or path for a specific route based on the given parameters.
Details
string
getPathFromRoute(string|Route $name, array $parameters = [])
Gets the internal path (system path) for a route.
string|GeneratedUrl
generateFromRoute(string|Route $name, array $parameters = [], array $options = [], bool $collect_bubbleable_metadata = FALSE)
| internal | Should not be used in user code. Use \Drupal\Core\Url instead. |
Generates a URL or path for a specific route based on the given parameters.
Parameters that reference placeholders in the route pattern will be substituted for them in the pattern. Extra params are added as query strings to the URL.