private function parseQueryParameters($bundle, $controller, $action, $query)
    {
        $url = '';

        if (0 !== count($query)) {
            $controller = (new BundleControllerResolver($this->_renderer->getApplication()))->resolve($bundle, $controller);

            $methodParameters = (new \ReflectionMethod($controller, $action.'Action'))->getParameters();

            $parameters = [];

            foreach ($methodParameters as $value) {
                if (!in_array($value->name, $query)) {
                    $parameters[$value->name] = $query[$value->name];
                    unset($query[$value->name]);
                }
            }

            if (count($parameters) !== 0) {
                $url .= '/'.implode('/', $parameters);
            }

            if (count($query) !== 0) {
                foreach ($query as $key => $value) {
                    $query[$key] = $key.'='.$value;
                }
                $url .= $url.'?'.implode('&', $query);
            }
        }

        return $url;
    }
private function parseQueryParameters($bundle, $controller, $action, $query)
    {
        $url = '';

        if (0 !== count($query)) {
            $controller = (new BundleControllerResolver($this->_renderer->getApplication()))->resolve($bundle, $controller);

            $methodParameters = (new \ReflectionMethod($controller, $action.'Action'))->getParameters();

            $parameters = [];

            foreach ($methodParameters as $value) {
                if (!in_array($value->name, $query)) {
                    $parameters[$value->name] = $query[$value->name];
                    unset($query[$value->name]);
                }
            }

            if (count($parameters) !== 0) {
                $url .= '/'.implode('/', $parameters);
            }

            if (count($query) !== 0) {
                foreach ($query as $key => $value) {
                    $query[$key] = $key.'='.$value;
                }
                $url .= $url.'?'.implode('&', $query);
            }
        }

        return $url;
    }
private function parseQueryParameters ( $ bundle , $ controller , $ action , $ query ) { $ url = '' ; if ( 0 !== count ( $ query ) ) { $ controller = ( new BundleControllerResolver ( $ this -> _renderer -> getApplication ( ) ) ) -> resolve ( $ bundle , $ controller ) ; $ methodParameters = ( new \ ReflectionMethod ( $ controller , $ action . 'Action' ) ) -> getParameters ( ) ; $ parameters = [ ] ; foreach ( $ methodParameters as $ value ) { if ( ! in_array ( $ value -> name , $ query ) ) { $ parameters [ $ value -> name ] = $ query [ $ value -> name ] ; unset ( $ query [ $ value -> name ] ) ; } } if ( count ( $ parameters ) !== 0 ) { $ url .= '/' . implode ( '/' , $ parameters ) ; } if ( count ( $ query ) !== 0 ) { foreach ( $ query as $ key => $ value ) { $ query [ $ key ] = $ key . '=' . $ value ; } $ url .= $ url . '?' . implode ( '&' , $ query ) ; } } return $ url ; }
parse query parameters to build the end of the url

@param  String $bundle
@param  String $controller
@param  String $action
@param  Array  $query

@return String
parse query parameters to build the end of the url