public function return(?int $code = null, ?string $path = null)
  {
    $info = ((isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '/') === '/' ? '' : $_SERVER['PATH_INFO']);

    if ($info !== '') $path = '?url=' . $info;

    if (count($_GET) > 0) {
      $path .= '&' . $_SERVER['QUERY_STRING'];
    }

    $this->url .= $path;

    if ($code !== null) {
      $this->code = $code;
      return $this->send();
    }

    return $this;
  }
public function return(?int $code = null, ?string $path = null)
  {
    $info = ((isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '/') === '/' ? '' : $_SERVER['PATH_INFO']);

    if ($info !== '') $path = '?url=' . $info;

    if (count($_GET) > 0) {
      $path .= '&' . $_SERVER['QUERY_STRING'];
    }

    $this->url .= $path;

    if ($code !== null) {
      $this->code = $code;
      return $this->send();
    }

    return $this;
  }
public function return ( ? int $ code = null , ? string $ path = null ) { $ info = ( ( isset ( $ _SERVER [ 'PATH_INFO' ] ) ? $ _SERVER [ 'PATH_INFO' ] : '/' ) === '/' ? '' : $ _SERVER [ 'PATH_INFO' ] ) ; if ( $ info !== '' ) $ path = '?url=' . $ info ; if ( count ( $ _GET ) > 0 ) { $ path .= '&' . $ _SERVER [ 'QUERY_STRING' ] ; } $ this -> url .= $ path ; if ( $ code !== null ) { $ this -> code = $ code ; return $ this -> send ( ) ; } return $ this ; }
Allow redirect to return to current url

@param integer $code
@return Redirect
Allow redirect to return to current url