MetadataBubblingUrlGenerator
class MetadataBubblingUrlGenerator implements UrlGeneratorInterface (View source)
Decorator for the URL generator, which bubbles bubbleable URL metadata.
Implements a decorator for the URL generator that allows to automatically collect and bubble up bubbleable metadata associated with URLs due to outbound path and route processing. This approach helps keeping the render and the routing subsystems decoupled.
Properties
| protected UrlGeneratorInterface | $urlGenerator | The non-bubbling URL generator. |
|
| protected RendererInterface | $renderer | The renderer. |
Methods
Constructs a new bubbling URL generator service.
{@inheritdoc}
{@inheritdoc}
Gets the internal path (system path) for a route.
Bubbles the bubbleable metadata to the current render context.
{@inheritdoc}
Generates a URL or path for a specific route based on the given parameters.
{@inheritdoc}
{@inheritdoc}
Details
__construct(UrlGeneratorInterface $url_generator, RendererInterface $renderer)
Constructs a new bubbling URL generator service.
setContext(RequestContext $context)
{@inheritdoc}
getContext()
{@inheritdoc}
string
getPathFromRoute(string|Route $name, array $parameters = [])
Gets the internal path (system path) for a route.
protected
bubble(GeneratedUrl $generated_url, array $options = [])
Bubbles the bubbleable metadata to the current render context.
string
generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH)
{@inheritdoc}
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.
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.
supports($name)
{@inheritdoc}
getRouteDebugMessage($name, array $parameters = [])
{@inheritdoc}