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
resolve(array $arguments, URLInterface $resolved = null)

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

$this|URLInterface|mixed|null
resolveRoute($route_handle, $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 resolve(array $arguments, URLInterface $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 $resolved

Return Value

URLInterface

private $this|URLInterface|mixed|null resolveRoute($route_handle, $route_parameters)

Resolve the route.

Parameters

$route_handle
$route_parameters

Return Value

$this|URLInterface|mixed|null