Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Uri.php

function Uri::isAbsolute

Whether the URI is absolute, i.e. it has a scheme.

An instance of UriInterface can either be an absolute URI or a relative reference. This method returns true if it is the former. An absolute URI has a scheme. A relative reference is used to express a URI relative to another URI, the base URI. Relative references can be divided into several forms:

  • network-path references, e.g. '//example.com/path'
  • absolute-path references, e.g. '/path'
  • relative-path references, e.g. 'subpath'

See also

Uri::isNetworkPathReference

Uri::isAbsolutePathReference

Uri::isRelativePathReference

https://datatracker.ietf.org/doc/html/rfc3986#section-4

File

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

Class

Uri
PSR-7 URI implementation.

Namespace

GuzzleHttp\Psr7

Code

public static function isAbsolute(UriInterface $uri) : bool {
    return $uri->getScheme() !== '';
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal