public function redirect($location, array $options = [])
    {
        $this->disableRendering();
        $location = (string) $this->uriGenerator->generate($location, $options);
        $response = new Response(302, '', ['Location' => $location]);
        $this->setResponse($response);
    }
public function redirect($location, array $options = [])
    {
        $this->disableRendering();
        $location = (string) $this->uriGenerator->generate($location, $options);
        $response = new Response(302, '', ['Location' => $location]);
        $this->setResponse($response);
    }
public function redirect ( $ location , array $ options = [ ] ) { $ this -> disableRendering ( ) ; $ location = ( string ) $ this -> uriGenerator -> generate ( $ location , $ options ) ; $ response = new Response ( 302 , '' , [ 'Location' => $ location ] ) ; $ this -> setResponse ( $ response ) ; }
Sets a redirection header in the HTTP response

@param string $location Location name, path or identifier
@param array $options Filter options

@return void
Sets a redirection header in the HTTP response