Automatically add missing URL parts of the current URL including
- querystring (especially for 3.x then)
- passed params

@param mixed|null $url
@param int|null $status
@return \Cake\Http\Response
764428
public function completeRedirect($url = null, $status = 302) {
		if ($url === null) {
			$url = $this->Controller->getRequest()->params;
			unset($url['pass']);
			unset($url['isAjax']);
		}
		if (is_array($url)) {
			$url += $this->Controller->getRequest()->getParam('pass');
		}
		return $this->Controller->redirect($url, $status);
	}
719977
public static function url($url, $params = null)
    {
        if (!is_array($params) || count($params) < 1) {
            return $url;
        }

        $pos = strpos($url, "?");

        # If there is no question mark in the url then set this as the first parameter
        if ($pos === false) {
            $url .= "?";

        # If the question mark is the last character then no appending is required
        } elseif ($pos != (mb_strlen($url) - 1)) {

            # If the last character is not an ampersand then append one
            if (mb_substr($url, -1) != "&") {
                $url .= "&";
            }
        }

        $url .= http_build_query($params);

        return $url;
    }
405317
public function respond(Status $status, $content = '')
    {
        $this->header($status);

        if (!empty($content)) {
            $this->send($content);
        }

        return $this;
    }
411468
public function getResponseBody($status, $nextUrl, $detail = null)
    {
        $body = [
            'Status=' . $status,
            'RedirectUrl=' . $nextUrl,
        ];

        if ($detail !== null) {
            $body[] = 'StatusDetail=' . $detail;
        }

        return implode(static::LINE_SEP, $body);
    }
1118286
public function products($status = null)
    {
        $query = [
            'status' => $status
        ];

        /** @var \SkyHub\Api\Handler\Response\HandlerInterface $responseHandler */
        $responseHandler = $this->service()->get($this->baseUrlPath(null, $query));
        return $responseHandler;
    }
841666
public function getResponse($url,$arguments=null){
        $this->get($url,$arguments);
        return $this->getBody();
    }
1359129
public function createRedirect(string $location, int $status = 307): ResponseInterface
    {
        return $this->responseFactory->createResponse($status)->withHeader('Location', $location);
    }
1162095
protected function respond($url)
    {
        $response = $this->request($url);
        $response = $this->parse($response);

        return $this->create($response);
    }
1007296
public function url(string $url = null) : self
    {
        if (! $url) {
            $url = null;

            $httpHost = getenv('APP_URL'); // Has to start with a protocol - for example "http://"!

            if ($httpHost === false) {
                $url = 'http';

                // Quick and dirty
                if (isset($_SERVER['HTTPS'])) {
                    $url .= 's';
                }

                $url .= '://';

                $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost/';
            }  

            $requestUri = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '';
            
            $safeRequestURI = htmlentities(strip_tags(urldecode($requestUri)));

            $url .= "{$httpHost}{$safeRequestURI}";
        } 

        if ($this->validate and ! filter_var($url, FILTER_VALIDATE_URL)) {
            throw new Exception("Open Graph: Invalid URL '{$url}'");
        }

        $this->forget('url');

        $this->tags[] = $this->createTag('url', $url);

        return $this;
    }
1369694
public function setStatus($status)
    {
        $statusAttribute = $this->statusAttribute;
        return (is_string($statusAttribute) && !empty($statusAttribute)) ? $this->$statusAttribute = $status : null;
    }
870270
public function redirect($url, $status = 302)
    {
        if ($status != 302) {
            $this->setStatus($status);
        }
        $this->setHeader('Location', $url);
        $this->sendHeader();
    }
985970
public function redirectAbs($url, $statusCode = 302)
    {
        $router = $this->getService('Router');
        $router->redirect($url, $statusCode);
        exit;
    }
321096
public function redirect($url, $statusCode = 302) {
		$this->setStatusCode($statusCode)
			->setHeader('Location', $url)
			->setBody(sprintf('<!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=%1$s">
<title>Redirecting to %1$s</title>
Redirecting to <a href="%1$s">%1$s</a>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')));

		return $this;
	}
80070
public function url($url = null)
    {
        if ($url === null) {
            return $this->_url;
        }
        $this->_url = $url;

        return $this;
    }
106818
public function back( $fallback = '', $status = 302 ) {
		$url = $this->request->headers( 'Referer' );

		if ( empty( $url ) ) {
			$url = $fallback;
		}

		if ( empty( $url ) ) {
			$url = $this->request->getUrl();
		}

		return $this->to( $url, $status );
	}
943257
public function build_url( $url, $options = array() ) {

		$url = (array) $url;

		$allow_port = (int) pods_v( static::$type . '_allow_port', $options, 0 );

		// If port is not allowed, always set to empty
		if ( 0 === $allow_port ) {
			$url['port'] = '';
		}

		if ( function_exists( 'http_build_url' ) ) {
			return http_build_url( $url );
		}

		$defaults = array(
			'scheme'   => 'http',
			'host'     => '',
			'port'     => '',
			'path'     => '/',
			'query'    => '',
			'fragment' => '',
		);

		$url = array_merge( $defaults, $url );

		$new_url = array();

		$new_url[] = trim( $url['scheme'] . '://', ':' );
		$new_url[] = $url['host'];

		if ( ! empty( $url['port'] ) ) {
			$new_url[] = ':' . $url['port'];
		}

		$new_url[] = '/' . ltrim( $url['path'], '/' );

		if ( ! empty( $url['query'] ) ) {
			$new_url[] = '?' . ltrim( $url['query'], '?' );
		}

		if ( ! empty( $url['fragment'] ) ) {
			$new_url[] = '#' . ltrim( $url['fragment'], '#' );
		}

		// Pull all of the parts back together
		$new_url = implode( '', $new_url );

		return $new_url;

	}
274314
public function post($url, array $params = [])
    {
        return $this->request($this->createUrl($url), self::METHOD_POST, $params);
    }