public function redirect($to, int $delay = 0) {
    $host = $this->server()->get('HTTP_HOST');
    
    $protocol = 'http';
    if ($this->server()->get('HTTPS')) {
      $protocol = 'https';
    }
    
    $domain = $protocol . '://' . $host;
    
    if ($delay !== 0) {
      header('Refresh: ' . $delay . '; url=' . $domain . '/' . $to);     
      return true;
    }
    
    header('Location: ' . $domain . '/' . $to);
    exit;
  }
public function redirect($to, int $delay = 0) {
    $host = $this->server()->get('HTTP_HOST');
    
    $protocol = 'http';
    if ($this->server()->get('HTTPS')) {
      $protocol = 'https';
    }
    
    $domain = $protocol . '://' . $host;
    
    if ($delay !== 0) {
      header('Refresh: ' . $delay . '; url=' . $domain . '/' . $to);     
      return true;
    }
    
    header('Location: ' . $domain . '/' . $to);
    exit;
  }
public function redirect ( $ to , int $ delay = 0 ) { $ host = $ this -> server ( ) -> get ( 'HTTP_HOST' ) ; $ protocol = 'http' ; if ( $ this -> server ( ) -> get ( 'HTTPS' ) ) { $ protocol = 'https' ; } $ domain = $ protocol . '://' . $ host ; if ( $ delay !== 0 ) { header ( 'Refresh: ' . $ delay . '; url=' . $ domain . '/' . $ to ) ; return true ; } header ( 'Location: ' . $ domain . '/' . $ to ) ; exit ; }
Redirect to another page with additional delay

@param string $to
@param int $delay

@return boolean
Redirect to another page with additional delay