UrlGeneratorTrait::getUrlGenerator

protected UrlGeneratorTrait::getUrlGenerator() Returns the URL generator service. Return value \Drupal\Core\Routing\UrlGeneratorInterface The URL generator service. File core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php, line 73 Class UrlGeneratorTrait Wrapper methods for the Url Generator. Namespace Drupal\Core\Routing Code protected function getUrlGenerator() { if (!$this->urlGenerator) { $this->urlGenerator = \Drupal::service('url_generator'); } return $this->ur

UrlGeneratorInterface::generateFromRoute

public UrlGeneratorInterface::generateFromRoute($name, $parameters = array(), $options = array(), $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. @internal Should not be used in user code. Use \Drupal\Core\Url instead. Parameters string|\Symfony\Component\Routing\Route $name

UrlGeneratorTrait::$urlGenerator

The url generator. Type: \Drupal\Core\Routing\UrlGeneratorInterface File core/lib/Drupal/Core/Routing/UrlGeneratorTrait.php, line 25 Class UrlGeneratorTrait Wrapper methods for the Url Generator. Namespace Drupal\Core\Routing Code protected $urlGenerator;

UrlGeneratorInterface::getPathFromRoute

public UrlGeneratorInterface::getPathFromRoute($name, $parameters = array()) Gets the internal path (system path) for a route. Parameters string|\Symfony\Component\Routing\Route $name: The route name or a route object. array $parameters: An array of parameters as passed to \Symfony\Component\Routing\Generator\UrlGeneratorInterface::generate(). Return value string The internal Drupal path corresponding to the route. File core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php, line 26 Class

UrlGeneratorInterface

Defines an interface for generating a url from a route or system path. Provides additional methods and options not present in the base interface. Hierarchy interface \Symfony\Cmf\Component\Routing\VersatileGeneratorInterface extends \Symfony\Cmf\Component\Routing\UrlGeneratorInterface interface \Drupal\Core\Routing\UrlGeneratorInterface File core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php, line 12 Namespace Drupal\Core\Routing Members Name Modifiers Type Description Ur

UrlGeneratorTrait

Wrapper methods for the Url Generator. This utility trait should only be used in application-level code, such as classes that would implement ContainerInjectionInterface. Services registered in the Container should not use this trait but inject the appropriate service directly for easier testing. Hierarchy trait \Drupal\Core\Routing\UrlGeneratorTrait Deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \Drupal\Core\Url instead. File core/lib/Drupal/Core/Routing/UrlGener

UrlGenerator::setContext

public UrlGenerator::setContext(SymfonyRequestContext $context) File core/lib/Drupal/Core/Routing/UrlGenerator.php, line 92 Class UrlGenerator Generates URLs from route names and parameters. Namespace Drupal\Core\Routing Code public function setContext(SymfonyRequestContext $context) { $this->context = $context; }

UrlGenerator::__construct

public UrlGenerator::__construct(RouteProviderInterface $provider, OutboundPathProcessorInterface $path_processor, OutboundRouteProcessorInterface $route_processor, RequestStack $request_stack, array $filter_protocols = ['http', 'https']) Constructs a new generator object. Parameters \Drupal\Core\Routing\RouteProviderInterface $provider: The route provider to be searched for routes. \Drupal\Core\PathProcessor\OutboundPathProcessorInterface $path_processor: The path processor to convert the sys

UrlGenerator::processRoute

protected UrlGenerator::processRoute($name, SymfonyRoute $route, array &$parameters, BubbleableMetadata $bubbleable_metadata = NULL) Passes the route to the processor manager for altering before compilation. Parameters string $name: The route name. \Symfony\Component\Routing\Route $route: The route object to process. array $parameters: An array of parameters to be passed to the route compiler. \Drupal\Core\Render\BubbleableMetadata $bubbleable_metadata: (optional) Object to collect route p

UrlGenerator::setStrictRequirements

public UrlGenerator::setStrictRequirements($enabled) File core/lib/Drupal/Core/Routing/UrlGenerator.php, line 106 Class UrlGenerator Generates URLs from route names and parameters. Namespace Drupal\Core\Routing Code public function setStrictRequirements($enabled) { // Ignore changes to this. }