public function retrieveCurrent(Request $request)
    {
        if (ConfigQuery::isRewritingEnable()) {
            $view = $request->attributes->get('_view', null);

            $viewLocale = $this->getViewLocale($request);

            $viewId = $view === null ? null : $request->query->get($view . '_id', null);

            $allOtherParameters = $request->query->all();
            if ($view !== null) {
                unset($allOtherParameters['view']);
                if ($viewId !== null) {
                    unset($allOtherParameters[$view . '_id']);
                }
            }
            if ($viewLocale !== null) {
                unset($allOtherParameters['lang']);
                unset($allOtherParameters['locale']);
            }

            $this->retriever->loadSpecificUrl($view, $viewLocale, $viewId, $allOtherParameters);
        } else {
            $allParametersWithoutView = $request->query->all();
            $view = $request->attributes->get('_view');
            if (isset($allOtherParameters['view'])) {
                unset($allOtherParameters['view']);
            }
            $this->retriever->rewrittenUrl = null;
            $this->retriever->url = URL::getInstance()->viewUrl($view, $allParametersWithoutView);
        }

        return $this->retriever;
    }
public function retrieveCurrent(Request $request)
    {
        if (ConfigQuery::isRewritingEnable()) {
            $view = $request->attributes->get('_view', null);

            $viewLocale = $this->getViewLocale($request);

            $viewId = $view === null ? null : $request->query->get($view . '_id', null);

            $allOtherParameters = $request->query->all();
            if ($view !== null) {
                unset($allOtherParameters['view']);
                if ($viewId !== null) {
                    unset($allOtherParameters[$view . '_id']);
                }
            }
            if ($viewLocale !== null) {
                unset($allOtherParameters['lang']);
                unset($allOtherParameters['locale']);
            }

            $this->retriever->loadSpecificUrl($view, $viewLocale, $viewId, $allOtherParameters);
        } else {
            $allParametersWithoutView = $request->query->all();
            $view = $request->attributes->get('_view');
            if (isset($allOtherParameters['view'])) {
                unset($allOtherParameters['view']);
            }
            $this->retriever->rewrittenUrl = null;
            $this->retriever->url = URL::getInstance()->viewUrl($view, $allParametersWithoutView);
        }

        return $this->retriever;
    }
public function retrieveCurrent ( Request $ request ) { if ( ConfigQuery :: isRewritingEnable ( ) ) { $ view = $ request -> attributes -> get ( '_view' , null ) ; $ viewLocale = $ this -> getViewLocale ( $ request ) ; $ viewId = $ view === null ? null : $ request -> query -> get ( $ view . '_id' , null ) ; $ allOtherParameters = $ request -> query -> all ( ) ; if ( $ view !== null ) { unset ( $ allOtherParameters [ 'view' ] ) ; if ( $ viewId !== null ) { unset ( $ allOtherParameters [ $ view . '_id' ] ) ; } } if ( $ viewLocale !== null ) { unset ( $ allOtherParameters [ 'lang' ] ) ; unset ( $ allOtherParameters [ 'locale' ] ) ; } $ this -> retriever -> loadSpecificUrl ( $ view , $ viewLocale , $ viewId , $ allOtherParameters ) ; } else { $ allParametersWithoutView = $ request -> query -> all ( ) ; $ view = $ request -> attributes -> get ( '_view' ) ; if ( isset ( $ allOtherParameters [ 'view' ] ) ) { unset ( $ allOtherParameters [ 'view' ] ) ; } $ this -> retriever -> rewrittenUrl = null ; $ this -> retriever -> url = URL :: getInstance ( ) -> viewUrl ( $ view , $ allParametersWithoutView ) ; } return $ this -> retriever ; }
Retrieve a rewritten URL from the current GET parameters

@param Request $request

@return RewritingRetriever You can access $url and $rewrittenUrl properties or use toString method
Retrieve a rewritten URL from the current GET parameters