RouterUrlResolver
class RouterUrlResolver implements UrlResolverInterface (View source)
Properties
protected RouterInterface | $router | ||
protected PathUrlResolver | $pathUrlResolver |
Methods
Get the url generator from the router.
Get the RouteCollection from the router.
Resolve urls from the list of registered routes takes a string.
Resolve the route.
Details
__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.
[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]
private URLInterface|null
resolveRoute(string $route_handle, array $route_parameters)
Resolve the route.