public function _redirect($url, $code = 303) {
        $base = $this->get('flight.base_url');

        if ($base === null) {
            $base = $this->request()->base;
        }

        // Append base url to redirect url
        if ($base != '/' && strpos($url, '://') === false) {
            $url = $base . preg_replace('#/+#', '/', '/' . $url);
        }

        $this->response()
            ->clear()
            ->status($code)
            ->header('Location', $url)
            ->send();
    }
public function _redirect($url, $code = 303) {
        $base = $this->get('flight.base_url');

        if ($base === null) {
            $base = $this->request()->base;
        }

        // Append base url to redirect url
        if ($base != '/' && strpos($url, '://') === false) {
            $url = $base . preg_replace('#/+#', '/', '/' . $url);
        }

        $this->response()
            ->clear()
            ->status($code)
            ->header('Location', $url)
            ->send();
    }
public function _redirect ( $ url , $ code = 303 ) { $ base = $ this -> get ( 'flight.base_url' ) ; if ( $ base === null ) { $ base = $ this -> request ( ) -> base ; } // Append base url to redirect url if ( $ base != '/' && strpos ( $ url , '://' ) === false ) { $ url = $ base . preg_replace ( '#/+#' , '/' , '/' . $ url ) ; } $ this -> response ( ) -> clear ( ) -> status ( $ code ) -> header ( 'Location' , $ url ) -> send ( ) ; }
Redirects the current request to another URL.

@param string $url URL
@param int $code HTTP status code
Redirects the current request to another URL .