LinkAdapter
in package
implements
LinkRendererInterface
FinalYes
Renders most of the links to elements, urls and urls with virtual schemes.
For more high level information on how references, see the documentation that accompanies this feature.
Tags
Table of Contents
Interfaces
- LinkRendererInterface
- Renders an HTML anchor pointing to the location of the provided element.
Properties
Methods
- __construct() : mixed
- render() : string|array<int, string>
- supports() : bool
- determineTitle() : string
- normalizePresentation() : string
- tryToResolveFqsenToDescriptor() : string|Path|Type|DescriptorAbstract|Fqsen|Reference
- Some passed types of value are references to an element; let's try to resolve these to a Descriptor.
Properties
$formatter read-only
private
HtmlFormatter
$formatter
$rendererChain read-only
private
LinkRenderer
$rendererChain
$urlGenerator read-only
private
UrlGenerator
$urlGenerator
Methods
__construct()
public
__construct(LinkRenderer $rendererChain, UrlGenerator $urlGenerator, HtmlFormatter $formatter) : mixed
Parameters
- $rendererChain : LinkRenderer
- $urlGenerator : UrlGenerator
- $formatter : HtmlFormatter
render()
public
render(mixed $value, string $presentation) : string|array<int, string>
Parameters
- $value : mixed
- $presentation : string
Return values
string|array<int, string>supports()
public
supports(mixed $value) : bool
Parameters
- $value : mixed
Return values
booldetermineTitle()
private
determineTitle(string|Path|Type|DescriptorAbstract|Fqsen|Reference|Fqsen $resolvedTarget) : string
Parameters
- $resolvedTarget : string|Path|Type|DescriptorAbstract|Fqsen|Reference|Fqsen
Return values
stringnormalizePresentation()
private
normalizePresentation(string|Path|Type|DescriptorAbstract|Fqsen|Reference|Fqsen $resolvedTarget, string $presentation) : string
Parameters
- $resolvedTarget : string|Path|Type|DescriptorAbstract|Fqsen|Reference|Fqsen
- $presentation : string
Return values
stringtryToResolveFqsenToDescriptor()
Some passed types of value are references to an element; let's try to resolve these to a Descriptor.
private
tryToResolveFqsenToDescriptor(string|Path|Type|DescriptorAbstract|Fqsen|Reference|Fqsen $target) : string|Path|Type|DescriptorAbstract|Fqsen|Reference
Should we not be able to resolve this to a Descriptor, we return the passed object or an FQSEN that could not be resolved because the element is not in the API docs.
Parameters
- $target : string|Path|Type|DescriptorAbstract|Fqsen|Reference|Fqsen