code/libraries/joomlatools/library/controller/response/response.php
public function setRedirect($location, $message = '', $type = self::FLASH_SUCCESS)
    {
        if (!empty($location))
        {
            if (!is_string($location) && !(is_object($location) && method_exists($location, '__toString')))
            {
                throw new UnexpectedValueException(
                    'The Response location must be a string or object implementing __toString(), "'.gettype($location).'" given.'
                );
            }
        }
        else throw new InvalidArgumentException('Cannot redirect to an empty URL.');

        //Add the message
        if(!empty($message)) {
           $this->addMessage($message, $type);
        }

        //Force the status code to 303 if no redirect status code is set.
        if(!$this->isRedirect()) {
            $this->setStatus(self::SEE_OTHER);
        }

        //Set the location header.
        $this->_headers->set('Location', (string) $location);

        return $this;
    }
public function setRedirect($location, $message = '', $type = self::FLASH_SUCCESS)
    {
        if (!empty($location))
        {
            if (!is_string($location) && !(is_object($location) && method_exists($location, '__toString')))
            {
                throw new UnexpectedValueException(
                    'The Response location must be a string or object implementing __toString(), "'.gettype($location).'" given.'
                );
            }
        }
        else throw new InvalidArgumentException('Cannot redirect to an empty URL.');

        //Add the message
        if(!empty($message)) {
           $this->addMessage($message, $type);
        }

        //Force the status code to 303 if no redirect status code is set.
        if(!$this->isRedirect()) {
            $this->setStatus(self::SEE_OTHER);
        }

        //Set the location header.
        $this->_headers->set('Location', (string) $location);

        return $this;
    }
public function setRedirect ( $ location , $ message = '' , $ type = self :: FLASH_SUCCESS ) { if ( ! empty ( $ location ) ) { if ( ! is_string ( $ location ) && ! ( is_object ( $ location ) && method_exists ( $ location , '__toString' ) ) ) { throw new UnexpectedValueException ( 'The Response location must be a string or object implementing __toString(), "' . gettype ( $ location ) . '" given.' ) ; } } else throw new InvalidArgumentException ( 'Cannot redirect to an empty URL.' ) ; //Add the message if ( ! empty ( $ message ) ) { $ this -> addMessage ( $ message , $ type ) ; } //Force the status code to 303 if no redirect status code is set. if ( ! $ this -> isRedirect ( ) ) { $ this -> setStatus ( self :: SEE_OTHER ) ; } //Set the location header. $ this -> _headers -> set ( 'Location' , ( string ) $ location ) ; return $ this ; }
Sets a redirect

Redirect to a URL externally. Method performs a 303 (see other) redirect if no other redirect status code is set
in the response. The flash message is a self-expiring messages that will only live for exactly one request before
being purged.

@see http://tools.ietf.org/html/rfc2616#section-10.3

@param string $location      The URL to redirect to. The URL should be a full URL, with schema etc.,
but practically every browser redirects on paths only as well
@param  string   $message    The flash message
@param  string   $type       The flash message category type. Default is 'success'.
@throws InvalidArgumentException If the location is empty
@throws UnexpectedValueException If the location is not a string, or cannot be cast to a string
@return KControllerResponse
Sets a redirect