public static function reverseToArray($params)
    {
        $url = [];
        if ($params instanceof ServerRequest) {
            $url = $params->getQueryParams();
            $params = $params->getAttribute('params');
        } elseif (isset($params['url'])) {
            $url = $params['url'];
        }
        $pass = isset($params['pass']) ? $params['pass'] : [];

        unset(
            $params['pass'],
            $params['paging'],
            $params['models'],
            $params['url'],
            $url['url'],
            $params['autoRender'],
            $params['bare'],
            $params['requested'],
            $params['return'],
            $params['_Token'],
            $params['_matchedRoute'],
            $params['_name']
        );
        $params = array_merge($params, $pass);
        if (!empty($url)) {
            $params['?'] = $url;
        }

        return $params;
    }
public static function reverseToArray($params)
    {
        $url = [];
        if ($params instanceof ServerRequest) {
            $url = $params->getQueryParams();
            $params = $params->getAttribute('params');
        } elseif (isset($params['url'])) {
            $url = $params['url'];
        }
        $pass = isset($params['pass']) ? $params['pass'] : [];

        unset(
            $params['pass'],
            $params['paging'],
            $params['models'],
            $params['url'],
            $url['url'],
            $params['autoRender'],
            $params['bare'],
            $params['requested'],
            $params['return'],
            $params['_Token'],
            $params['_matchedRoute'],
            $params['_name']
        );
        $params = array_merge($params, $pass);
        if (!empty($url)) {
            $params['?'] = $url;
        }

        return $params;
    }
public static function reverseToArray ( $ params ) { $ url = [ ] ; if ( $ params instanceof ServerRequest ) { $ url = $ params -> getQueryParams ( ) ; $ params = $ params -> getAttribute ( 'params' ) ; } elseif ( isset ( $ params [ 'url' ] ) ) { $ url = $ params [ 'url' ] ; } $ pass = isset ( $ params [ 'pass' ] ) ? $ params [ 'pass' ] : [ ] ; unset ( $ params [ 'pass' ] , $ params [ 'paging' ] , $ params [ 'models' ] , $ params [ 'url' ] , $ url [ 'url' ] , $ params [ 'autoRender' ] , $ params [ 'bare' ] , $ params [ 'requested' ] , $ params [ 'return' ] , $ params [ '_Token' ] , $ params [ '_matchedRoute' ] , $ params [ '_name' ] ) ; $ params = array_merge ( $ params , $ pass ) ; if ( ! empty ( $ url ) ) { $ params [ '?' ] = $ url ; } return $ params ; }
Reverses a parsed parameter array into an array.

Works similarly to Router::url(), but since parsed URL's contain additional
'pass' as well as 'url.url' keys. Those keys need to be specially
handled in order to reverse a params array into a string URL.

This will strip out 'autoRender', 'bare', 'requested', and 'return' param names as those
are used for CakePHP internals and should not normally be part of an output URL.

@param \Cake\Http\ServerRequest|array $params The params array or
Cake\Http\ServerRequest object that needs to be reversed.
@return array The URL array ready to be used for redirect or HTML link.
Reverses a parsed parameter array into an array .