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

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;

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

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::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

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

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::supports

public UrlGenerator::supports($name) Whether this generator supports the supplied $name. This check does not need to look if the specific instance can be resolved to a route, only whether the router can generate routes from objects of this class. Parameters mixed $name The route "name" which may also be an object or anything: Return value bool Overrides VersatileGeneratorInterface::supports File core/lib/Drupal/Core/Routing/UrlGenerator.php, line 434 Class UrlGenerator Generates URLs fro

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. }

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; }