src/Http/Router.php
private function handleRoute($info, ServerRequestInterface $request, $route) : ResponseInterface
    {
        // initialize router attributes for the request
        $attributes = [
            'params' => [
                'url' => [],
                'host' => []
            ]
        ];

        // prepare parameters
        if ($paramstr = substr($request->getUri()->getPath(), strlen($route))) {
            $attributes['params']['url'] = $this->filterParameters($info['parameters'], explode("/", $paramstr));
        }

        // check host parameters
        if (count($info["hostparameters"]) > 0) {
            $attributes['params']['host'] = $this->extractHostParameters($request, $info);
        }

        // put route parameters into king23.router.parameters attribute
        $request = $request->withAttribute('king23.router', $attributes);

        /** @var \King23\Controller\Controller $controller */
        $controller = $this->container->get($info["class"]);

        return $controller->dispatch($info["action"], $request);
    }
private function handleRoute($info, ServerRequestInterface $request, $route) : ResponseInterface
    {
        // initialize router attributes for the request
        $attributes = [
            'params' => [
                'url' => [],
                'host' => []
            ]
        ];

        // prepare parameters
        if ($paramstr = substr($request->getUri()->getPath(), strlen($route))) {
            $attributes['params']['url'] = $this->filterParameters($info['parameters'], explode("/", $paramstr));
        }

        // check host parameters
        if (count($info["hostparameters"]) > 0) {
            $attributes['params']['host'] = $this->extractHostParameters($request, $info);
        }

        // put route parameters into king23.router.parameters attribute
        $request = $request->withAttribute('king23.router', $attributes);

        /** @var \King23\Controller\Controller $controller */
        $controller = $this->container->get($info["class"]);

        return $controller->dispatch($info["action"], $request);
    }
private function handleRoute ( $ info , ServerRequestInterface $ request , $ route ) : ResponseInterface { // initialize router attributes for the request $ attributes = [ 'params' => [ 'url' => [ ] , 'host' => [ ] ] ] ; // prepare parameters if ( $ paramstr = substr ( $ request -> getUri ( ) -> getPath ( ) , strlen ( $ route ) ) ) { $ attributes [ 'params' ] [ 'url' ] = $ this -> filterParameters ( $ info [ 'parameters' ] , explode ( "/" , $ paramstr ) ) ; } // check host parameters if ( count ( $ info [ "hostparameters" ] ) > 0 ) { $ attributes [ 'params' ] [ 'host' ] = $ this -> extractHostParameters ( $ request , $ info ) ; } // put route parameters into king23.router.parameters attribute $ request = $ request -> withAttribute ( 'king23.router' , $ attributes ) ; /** @var \King23\Controller\Controller $controller */ $ controller = $ this -> container -> get ( $ info [ "class" ] ) ; return $ controller -> dispatch ( $ info [ "action" ] , $ request ) ; }
Handle a regular route

@param array $info
@param ServerRequestInterface $request
@param string $route
@return ResponseInterface
@throws \King23\Controller\Exceptions\ActionDoesNotExistException
Handle a regular route