public function setRedirect($url, $code = 302)
    {
        $this->canSendHeaders(true);
        $this->setHeader('Location', $url, true)
             ->setHttpResponseCode($code);

        return $this;
    }
public function setRedirect($url, $code = 302)
    {
        $this->canSendHeaders(true);
        $this->setHeader('Location', $url, true)
             ->setHttpResponseCode($code);

        return $this;
    }
public function setRedirect ( $ url , $ code = 302 ) { $ this -> canSendHeaders ( true ) ; $ this -> setHeader ( 'Location' , $ url , true ) -> setHttpResponseCode ( $ code ) ; return $ this ; }
Set redirect URL

Sets Location header and response code. Forces replacement of any prior
redirects.

@param string $url
@param int $code
@return \G4\Http\Response
Set redirect URL