You are here

public function Uri::getPath in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-diactoros/src/Uri.php \Zend\Diactoros\Uri::getPath()
  2. 8 vendor/zendframework/zend-feed/src/Uri.php \Zend\Feed\Uri::getPath()
  3. 8 vendor/guzzlehttp/psr7/src/Uri.php \GuzzleHttp\Psr7\Uri::getPath()
Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/psr7/src/Uri.php \GuzzleHttp\Psr7\Uri::getPath()

Retrieve the path component of the URI.

The path can either be empty or absolute (starting with a slash) or rootless (not starting with a slash). Implementations MUST support all three syntaxes.

Normally, the empty path "" and absolute path "/" are considered equal as defined in RFC 7230 Section 2.7.3. But this method MUST NOT automatically do this normalization because in contexts with a trimmed base path, e.g. the front controller, this difference becomes significant. It's the task of the user to handle both "" and "/".

The value returned MUST be percent-encoded, but MUST NOT double-encode any characters. To determine what characters to encode, please refer to RFC 3986, Sections 2 and 3.3.

As an example, if the value should include a slash ("/") not intended as delimiter between path segments, that value MUST be passed in encoded form (e.g., "%2F") to the instance.

Return value

string The URI path.

Overrides UriInterface::getPath

See also

https://tools.ietf.org/html/rfc3986#section-2

https://tools.ietf.org/html/rfc3986#section-3.3

1 call to Uri::getPath()
Uri::__toString in vendor/guzzlehttp/psr7/src/Uri.php
Return the string representation as a URI reference.

File

vendor/guzzlehttp/psr7/src/Uri.php, line 307

Class

Uri
Basic PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

public function getPath() {
  return $this->path == null ? '' : $this->path;
}