private static function fillCurrentRouteString(self $request)
    {
        //Read data from $_SERVER array
        $requestUri = urldecode($_SERVER['REQUEST_URI']);
        $scriptName = $_SERVER['SCRIPT_NAME'];

        //Extract route string from the URI
        $length = strlen(dirname($scriptName));
        $routeAux = substr(explode('?', $requestUri)[0], $length);
        $route = '/';

        if ($routeAux && $routeAux != '/') {
            $route .= trim(str_replace('\\', '/', $routeAux), '/').'/';
        }

        $request->setRouteStr($route);
    }
private static function fillCurrentRouteString(self $request)
    {
        //Read data from $_SERVER array
        $requestUri = urldecode($_SERVER['REQUEST_URI']);
        $scriptName = $_SERVER['SCRIPT_NAME'];

        //Extract route string from the URI
        $length = strlen(dirname($scriptName));
        $routeAux = substr(explode('?', $requestUri)[0], $length);
        $route = '/';

        if ($routeAux && $routeAux != '/') {
            $route .= trim(str_replace('\\', '/', $routeAux), '/').'/';
        }

        $request->setRouteStr($route);
    }
private static function fillCurrentRouteString ( self $ request ) { //Read data from $_SERVER array $ requestUri = urldecode ( $ _SERVER [ 'REQUEST_URI' ] ) ; $ scriptName = $ _SERVER [ 'SCRIPT_NAME' ] ; //Extract route string from the URI $ length = strlen ( dirname ( $ scriptName ) ) ; $ routeAux = substr ( explode ( '?' , $ requestUri ) [ 0 ] , $ length ) ; $ route = '/' ; if ( $ routeAux && $ routeAux != '/' ) { $ route .= trim ( str_replace ( '\\' , '/' , $ routeAux ) , '/' ) . '/' ; } $ request -> setRouteStr ( $ route ) ; }
Capture the route string.

@param Request $request
Capture the route string .