phpDocumentor

Target
in package

FinalYes

The target of a link and how it should be presented.

Links in phpDocumentor can be based on any number of types of input, ranging from FQCNs, Descriptors, absolute urls to things like references.

To simplify the rendering of these links, we first analyze and transform the input into this Target object. Once the object is formed, it is passed onto the LinkAdapter to transform it into an actual HTML link that can be shown.

Table of Contents

Properties

$abbreviation  : string|null
Targets can optionally have their link text be an abbreviation.
$presentation  : string
How should the HTML be formatted.
$title  : string
The title of the target that needs to be shown in the link text, or when an abbreviation is present as part of the ABBR tag's title attribute.
$url  : string|null
The link url of this Target.

Methods

__construct()  : mixed
getAbbreviation()  : string|null
getPresentation()  : string
getTitle()  : string
getUrl()  : string|null
setPresentation()  : void

Properties

$abbreviation

Targets can optionally have their link text be an abbreviation.

private string|null $abbreviation

When this field is not null, it is used as the link text and the regular title is set as the title attribute of a generated ABBR tag.

$presentation

How should the HTML be formatted.

private string $presentation

The HtmlFormatter is responsible for transforming this target into HTML; but the presentation of a link can vary depending on where it is used. When used in twig templates, the caller can indicate how an element should be rendered according to this presentation.

Tags
see
LinkRenderer

for the possible presentation options.

$title read-only

The title of the target that needs to be shown in the link text, or when an abbreviation is present as part of the ABBR tag's title attribute.

private string $title

$url read-only

The link url of this Target.

private string|null $url = null

The LinkRenderer is responsible for converting an 'input' to something that can be linked to; and the URL represents the thing that should be linked to.

Sometimes, input cannot be resolved (FQCNs that we do not document). When that happens the URL is null, and the HtmlFormatter will still render a reference to that FQCN, but without a link.

Methods

__construct()

public __construct(string $title[, string|null $url = null ][, string $presentation = LinkRenderer::PRESENTATION_NORMAL ]) : mixed
Parameters
$title : string
$url : string|null = null
$presentation : string = LinkRenderer::PRESENTATION_NORMAL

getAbbreviation()

public getAbbreviation() : string|null
Return values
string|null

getPresentation()

public getPresentation() : string
Return values
string

getTitle()

public getTitle() : string
Return values
string

getUrl()

public getUrl() : string|null
Return values
string|null

setPresentation()

private setPresentation(string $presentation) : void
Parameters
$presentation : string

        
On this page

Search results