class RouterUrlResolver implements UrlResolverInterface (View source)

Properties

protected RouterInterface $router
protected PathUrlResolver $pathUrlResolver

Methods

__construct(PathUrlResolver $path_url_resolver, RouterInterface $router)

No description

UrlGeneratorInterface
getGenerator()

Get the url generator from the router.

RouteCollection
getRouteList()

Get the RouteCollection from the router.

URLInterface|null
resolve(array $arguments, URLInterface|null $resolved = null)

Resolve urls from the list of registered routes takes a string.

URLInterface|null
resolveRoute(string $route_handle, array $route_parameters)

Resolve the route.

Details

__construct(PathUrlResolver $path_url_resolver, RouterInterface $router)

No description

Parameters

PathUrlResolver $path_url_resolver
RouterInterface $router

UrlGeneratorInterface getGenerator()

Get the url generator from the router.

Return Value

UrlGeneratorInterface

RouteCollection getRouteList()

Get the RouteCollection from the router.

Return Value

RouteCollection

URLInterface|null resolve(array $arguments, URLInterface|null $resolved = null)

Resolve urls from the list of registered routes takes a string.

[code] $url = \URL::to('route/user_route', array('id' => 1)); [/code]

OR

[code] // Register a route $route_list->register('/users/{id}', '\My\Application\User\Controller::view', 'user_route');

// Create a resolver $route_url_resolver = new \Concrete\Core\Url\Resolver\RouteUrlResolver($generator, $route_list);

// Retrieve the URL $url = $route_url_resolver->resolve(array('route/user_route', array('id' => 1))); [/code]

Parameters

array $arguments

A list of the arguments

URLInterface|null $resolved

Return Value

URLInterface|null

private URLInterface|null resolveRoute(string $route_handle, array $route_parameters)

Resolve the route.

Parameters

string $route_handle
array $route_parameters

Return Value

URLInterface|null