public function createRedirectResponse(View $view, $location, $format)
    {
        $content = null;
        if ((Response::HTTP_CREATED === $view->getStatusCode() || Response::HTTP_ACCEPTED === $view->getStatusCode()) && null !== $view->getData()) {
            $response = $this->initResponse($view, $format);
        } else {
            $response = $view->getResponse();
            if ('html' === $format && isset($this->forceRedirects[$format])) {
                $redirect = new RedirectResponse($location);
                $content = $redirect->getContent();
                $response->setContent($content);
            }
        }

        $code = isset($this->forceRedirects[$format])
            ? $this->forceRedirects[$format] : $this->getStatusCode($view, $content);

        $response->setStatusCode($code);
        $response->headers->set('Location', $location);

        return $response;
    }
public function createRedirectResponse(View $view, $location, $format)
    {
        $content = null;
        if ((Response::HTTP_CREATED === $view->getStatusCode() || Response::HTTP_ACCEPTED === $view->getStatusCode()) && null !== $view->getData()) {
            $response = $this->initResponse($view, $format);
        } else {
            $response = $view->getResponse();
            if ('html' === $format && isset($this->forceRedirects[$format])) {
                $redirect = new RedirectResponse($location);
                $content = $redirect->getContent();
                $response->setContent($content);
            }
        }

        $code = isset($this->forceRedirects[$format])
            ? $this->forceRedirects[$format] : $this->getStatusCode($view, $content);

        $response->setStatusCode($code);
        $response->headers->set('Location', $location);

        return $response;
    }
public function createRedirectResponse ( View $ view , $ location , $ format ) { $ content = null ; if ( ( Response :: HTTP_CREATED === $ view -> getStatusCode ( ) || Response :: HTTP_ACCEPTED === $ view -> getStatusCode ( ) ) && null !== $ view -> getData ( ) ) { $ response = $ this -> initResponse ( $ view , $ format ) ; } else { $ response = $ view -> getResponse ( ) ; if ( 'html' === $ format && isset ( $ this -> forceRedirects [ $ format ] ) ) { $ redirect = new RedirectResponse ( $ location ) ; $ content = $ redirect -> getContent ( ) ; $ response -> setContent ( $ content ) ; } } $ code = isset ( $ this -> forceRedirects [ $ format ] ) ? $ this -> forceRedirects [ $ format ] : $ this -> getStatusCode ( $ view , $ content ) ; $ response -> setStatusCode ( $ code ) ; $ response -> headers -> set ( 'Location' , $ location ) ; return $ response ; }
Creates the Response from the view.

@param View   $view
@param string $location
@param string $format

@return Response
Creates the Response from the view .