PHP Class Essence\Utility\Url

Mostrar archivo Open project: benjamminf/craft-embedded-assets Class Usage Examples

Public Methods

Method Description
host ( array $parts ) : string Builds the full host part of an URL.
path ( array $parts ) : string Builds the full path part of an URL.
resolve ( string $url, string $base ) : string Resolves relative URLs.
resolveAll ( array $urls, string $base ) : array Resolves a set of relative URLs.
resolvePath ( string $urlPath, string $basePath ) : array Resolves relative paths.
splitPath ( string $path ) : array Splits a path in parts.

Method Details

host() public static method

Builds the full host part of an URL.
public static host ( array $parts ) : string
$parts array URL parts.
return string URL.

path() public static method

Builds the full path part of an URL.
public static path ( array $parts ) : string
$parts array URL parts.
return string URL.

resolve() public static method

Resolves relative URLs.
public static resolve ( string $url, string $base ) : string
$url string URL to resolve.
$base string URL of the page from which URLs were extracted.
return string Resolved URL.

resolveAll() public static method

Resolves a set of relative URLs.
See also: resolve()
public static resolveAll ( array $urls, string $base ) : array
$urls array URLs to resolve.
$base string URL of the page from which URLs were extracted.
return array Resolved URLs.

resolvePath() public static method

Resolves relative paths.
public static resolvePath ( string $urlPath, string $basePath ) : array
$urlPath string URLs to resolve.
$basePath string URL of the page from which URLs were extracted.
return array Resolved path.

splitPath() public static method

Splits a path in parts.
public static splitPath ( string $path ) : array
$path string Path.
return array Parts.