public function redirect($location, $temporarily = true)
    {
        if ($temporarily) {
            $this->setStatus(302, 'Temporarily Moved');
        } else {
            $this->setStatus(301, 'Permanently Moved');
        }

        $this->setHeader('Location', $this->url->get($location));

        throw new AbortException();

        /** @noinspection PhpUnreachableStatementInspection */
        return $this;
    }
public function redirect($location, $temporarily = true)
    {
        if ($temporarily) {
            $this->setStatus(302, 'Temporarily Moved');
        } else {
            $this->setStatus(301, 'Permanently Moved');
        }

        $this->setHeader('Location', $this->url->get($location));

        throw new AbortException();

        /** @noinspection PhpUnreachableStatementInspection */
        return $this;
    }
public function redirect ( $ location , $ temporarily = true ) { if ( $ temporarily ) { $ this -> setStatus ( 302 , 'Temporarily Moved' ) ; } else { $ this -> setStatus ( 301 , 'Permanently Moved' ) ; } $ this -> setHeader ( 'Location' , $ this -> url -> get ( $ location ) ) ; throw new AbortException ( ) ; /** @noinspection PhpUnreachableStatementInspection */ return $ this ; }
Redirect by HTTP to another action or URL

@param string|array $location
@param bool         $temporarily

@return static
Redirect by HTTP to another action or URL