Documentation

UrlGenerator
in package

Table of Contents

absoluteUrl()  : string
Returns the absolute path, including prefixing '/'.
canonicalUrl()  : string
Returns the Path used in the Metas to find this file.
generateUrl()  : string
relativeUrl()  : string
Resolves a relative URL.

Methods

absoluteUrl()

Returns the absolute path, including prefixing '/'.

public absoluteUrl(string $basePath, string $url) : string

This method will, by design, return an absolute path including the prefixing slash. The slash will make it clear to the other URL generating methods that this need not be resolved and can stay the same.

Parameters
$basePath : string
$url : string
Return values
string

canonicalUrl()

Returns the Path used in the Metas to find this file.

public canonicalUrl(string $basePath, string $url) : string

The Metas collection, which is used to build the table of contents, uses these canonical paths as a unique identifier to find the metadata for that file. Technically speaking, the canonical URL is the absolute URL without the preceeding slash. But due to the many locations that this method is used; it will do its own resolving.

Parameters
$basePath : string
$url : string
Tags
todo

simplify this method into the other methods or vice versa

Return values
string

generateUrl()

public generateUrl(string $path, string $dirName) : string
Parameters
$path : string
$dirName : string
Return values
string

relativeUrl()

Resolves a relative URL.

public relativeUrl(string $url) : string
Parameters
$url : string
Return values
string

Search results