public function redirectTo($target, $headerCode = 301, $withOrigin = false)
    {
        if (!($this->request instanceof WebRequest)) {
            return;
        }
        
        if (!preg_match('/http(s?)\:\/\//', $target)) {
            $target = $this->request->getFullRoute($target);
        }
        
        if ($withOrigin) {
            $target = $this->addOriginToTargetUrl($target);
        }
        
        header("Location: " . $target, true, $headerCode);
    }
public function redirectTo($target, $headerCode = 301, $withOrigin = false)
    {
        if (!($this->request instanceof WebRequest)) {
            return;
        }
        
        if (!preg_match('/http(s?)\:\/\//', $target)) {
            $target = $this->request->getFullRoute($target);
        }
        
        if ($withOrigin) {
            $target = $this->addOriginToTargetUrl($target);
        }
        
        header("Location: " . $target, true, $headerCode);
    }
public function redirectTo ( $ target , $ headerCode = 301 , $ withOrigin = false ) { if ( ! ( $ this -> request instanceof WebRequest ) ) { return ; } if ( ! preg_match ( '/http(s?)\:\/\//' , $ target ) ) { $ target = $ this -> request -> getFullRoute ( $ target ) ; } if ( $ withOrigin ) { $ target = $ this -> addOriginToTargetUrl ( $ target ) ; } header ( "Location: " . $ target , true , $ headerCode ) ; }
Set the Location header to redirect a request

@access public
@param string $target
@param integer $headerCode
@param boolean $withOrigin
Set the Location header to redirect a request