NullGenerator
class NullGenerator extends UrlGenerator (View source)
No-op implementation of a Url Generator, needed for backward compatibility.
Properties
| protected RouteProviderInterface | $provider | The route provider. |
from UrlGenerator |
| protected RequestContext | $context | from UrlGenerator | |
| protected RequestStack | $requestStack | A request stack object. |
from UrlGenerator |
| protected OutboundPathProcessorInterface | $pathProcessor | The path processor to convert the system path to one suitable for urls. |
from UrlGenerator |
| protected OutboundRouteProcessorInterface | $routeProcessor | The route processor. |
from UrlGenerator |
| protected | $decodedChars | Overrides characters that will not be percent-encoded in the path segment. |
from UrlGenerator |
Methods
Override the parent constructor.
{@inheritdoc}
{@inheritdoc}
Gets the internal path (system path) for a route.
Substitute the route parameters into the route path.
Gets the path of a route.
{@inheritdoc}
Generates a URL or path for a specific route based on the given parameters.
Passes the path to a processor manager to allow alterations.
Passes the route to the processor manager for altering before compilation.
Find the route using the provided route name.
Details
__construct(RequestStack $request_stack)
Override the parent constructor.
setContext(RequestContext $context)
{@inheritdoc}
getContext()
{@inheritdoc}
setStrictRequirements($enabled)
{@inheritdoc}
isStrictRequirements()
{@inheritdoc}
string
getPathFromRoute(string|Route $name, array $parameters = [])
Gets the internal path (system path) for a route.
protected string
doGenerate(array $variables, array $defaults, array $tokens, array $parameters, array $query_params, string $name)
Substitute the route parameters into the route path.
Note: This code was copied from \Symfony\Component\Routing\Generator\UrlGenerator::doGenerate() and shortened by removing code that is not relevant to Drupal or that is handled separately in ::generateFromRoute(). The Symfony version should be examined for changes in new Symfony releases.
protected string
getInternalPathFromRoute($name, Route $route, array $parameters = [], array $query_params = [])
Gets the path of a route.
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.
protected
processPath($path, $options = [], BubbleableMetadata $bubbleable_metadata = NULL)
Passes the path to a processor manager to allow alterations.
protected
processRoute(string $name, Route $route, array $parameters, BubbleableMetadata $bubbleable_metadata = NULL)
Passes the route to the processor manager for altering before compilation.
protected Route
getRoute(string|Route $name)
Find the route using the provided route name.
supports($name)
{@inheritdoc}
getRouteDebugMessage($name, array $parameters = [])
{@inheritdoc}