public function handle(ComponentContext $componentContext)
    {
        $parameters = $componentContext->getParameter(RoutingComponent::class, 'parameters');
        if ($parameters === null) {
            $parameters = RouteParameters::createEmpty();
        }
        $routeContext = new RouteContext($componentContext->getHttpRequest(), $parameters);

        try {
            $matchResults = $this->router->route($routeContext);
        } catch (NoMatchingRouteException $exception) {
            $matchResults = null;
        }

        $componentContext->setParameter(RoutingComponent::class, 'matchResults', $matchResults);
    }
public function handle(ComponentContext $componentContext)
    {
        $parameters = $componentContext->getParameter(RoutingComponent::class, 'parameters');
        if ($parameters === null) {
            $parameters = RouteParameters::createEmpty();
        }
        $routeContext = new RouteContext($componentContext->getHttpRequest(), $parameters);

        try {
            $matchResults = $this->router->route($routeContext);
        } catch (NoMatchingRouteException $exception) {
            $matchResults = null;
        }

        $componentContext->setParameter(RoutingComponent::class, 'matchResults', $matchResults);
    }
public function handle ( ComponentContext $ componentContext ) { $ parameters = $ componentContext -> getParameter ( RoutingComponent :: class , 'parameters' ) ; if ( $ parameters === null ) { $ parameters = RouteParameters :: createEmpty ( ) ; } $ routeContext = new RouteContext ( $ componentContext -> getHttpRequest ( ) , $ parameters ) ; try { $ matchResults = $ this -> router -> route ( $ routeContext ) ; } catch ( NoMatchingRouteException $ exception ) { $ matchResults = null ; } $ componentContext -> setParameter ( RoutingComponent :: class , 'matchResults' , $ matchResults ) ; }
Resolve a route for the request

Stores the resolved route values in the ComponentContext to pass them
to other components. They can be accessed via ComponentContext::getParameter(outingComponent::class, 'matchResults');

@param ComponentContext $componentContext
@return void
Resolve a route for the request