Esempio n. 1
0
 /**
  * Create the Response from the view
  *
  * @param View   $view
  * @param string $location
  * @param string $format
  *
  * @return Response
  */
 public function createRedirectResponse($view, $location, $format)
 {
     $content = null;
     $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;
 }