src/ActionRequest.php
public static function findPath(\Psr\Http\Message\ServerRequestInterface $request)
    {
        $server = $request->getServerParams();
        $path = $request->getUri()->getPath();
        if (isset($server['SCRIPT_NAME'])) {
            $basePath = dirname($server['SCRIPT_NAME']);
            if ($basePath != '/') {
                $length = strlen($basePath);
                if (substr($path, 0, $length) == $basePath) {
                    $path = substr($path, $length);
                }
            }
        }
        if ($path == '/' or $path == '') {
            return [];
        }
        if ($path[0] == '/') {
            $path = substr($path, 1);
        }
        return array_map('urldecode', explode('/', $path));
    }
public static function findPath(\Psr\Http\Message\ServerRequestInterface $request)
    {
        $server = $request->getServerParams();
        $path = $request->getUri()->getPath();
        if (isset($server['SCRIPT_NAME'])) {
            $basePath = dirname($server['SCRIPT_NAME']);
            if ($basePath != '/') {
                $length = strlen($basePath);
                if (substr($path, 0, $length) == $basePath) {
                    $path = substr($path, $length);
                }
            }
        }
        if ($path == '/' or $path == '') {
            return [];
        }
        if ($path[0] == '/') {
            $path = substr($path, 1);
        }
        return array_map('urldecode', explode('/', $path));
    }
public static function findPath ( \ Psr \ Http \ Message \ ServerRequestInterface $ request ) { $ server = $ request -> getServerParams ( ) ; $ path = $ request -> getUri ( ) -> getPath ( ) ; if ( isset ( $ server [ 'SCRIPT_NAME' ] ) ) { $ basePath = dirname ( $ server [ 'SCRIPT_NAME' ] ) ; if ( $ basePath != '/' ) { $ length = strlen ( $ basePath ) ; if ( substr ( $ path , 0 , $ length ) == $ basePath ) { $ path = substr ( $ path , $ length ) ; } } } if ( $ path == '/' or $ path == '' ) { return [ ] ; } if ( $ path [ 0 ] == '/' ) { $ path = substr ( $ path , 1 ) ; } return array_map ( 'urldecode' , explode ( '/' , $ path ) ) ; }
Find the path array for a request.

@param \Psr\Http\Message\ServerRequestInterface $request
@return string[]
Find the path array for a request .