protected function redirect($source, array $parameters = array(), $code = 307)
    {
        if ($source instanceof Url) {
            $url = $source->toString();
        } elseif (filter_var($source, FILTER_VALIDATE_URL)) {
            $url = $source;
        } else {
            $url = $this->reverseRouter->getUrl($source, $parameters);
        }

        if ($code == 301) {
            throw new StatusCode\MovedPermanentlyException($url);
        } elseif ($code == 302) {
            throw new StatusCode\FoundException($url);
        } elseif ($code == 307) {
            throw new StatusCode\TemporaryRedirectException($url);
        } else {
            throw new RuntimeException('Invalid redirect status code');
        }
    }
protected function redirect($source, array $parameters = array(), $code = 307)
    {
        if ($source instanceof Url) {
            $url = $source->toString();
        } elseif (filter_var($source, FILTER_VALIDATE_URL)) {
            $url = $source;
        } else {
            $url = $this->reverseRouter->getUrl($source, $parameters);
        }

        if ($code == 301) {
            throw new StatusCode\MovedPermanentlyException($url);
        } elseif ($code == 302) {
            throw new StatusCode\FoundException($url);
        } elseif ($code == 307) {
            throw new StatusCode\TemporaryRedirectException($url);
        } else {
            throw new RuntimeException('Invalid redirect status code');
        }
    }
protected function redirect ( $ source , array $ parameters = array ( ) , $ code = 307 ) { if ( $ source instanceof Url ) { $ url = $ source -> toString ( ) ; } elseif ( filter_var ( $ source , FILTER_VALIDATE_URL ) ) { $ url = $ source ; } else { $ url = $ this -> reverseRouter -> getUrl ( $ source , $ parameters ) ; } if ( $ code == 301 ) { throw new StatusCode \ MovedPermanentlyException ( $ url ) ; } elseif ( $ code == 302 ) { throw new StatusCode \ FoundException ( $ url ) ; } elseif ( $ code == 307 ) { throw new StatusCode \ TemporaryRedirectException ( $ url ) ; } else { throw new RuntimeException ( 'Invalid redirect status code' ) ; } }
Throws an redirect exception which sends an Location header. If source is
not an url the reverse router is used to determine the url

@param string $source
@param array $parameters
@param integer $code
@deprecated
Throws an redirect exception which sends an Location header . If source is not an url the reverse router is used to determine the url